// addToPoolSet adds the id of the worker pool to a set of active pools
// in the database.
15661
func (p *Pool) addToPoolSet() error {
	conn := redisPool.Get()
	defer conn.Close()
	p.RLock()
	thisId := p.id
	p.RUnlock()
	if _, err := conn.Do("SADD", Keys.ActivePools, thisId); err != nil {
		return err
	}
	return nil
}
324249
func (c *Client) AddAccountToProject(p *AddAccountToProjectParameter) (*Result, error) {
	obj, err := c.Request("addAccountToProject", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*Result), err
}
552876
func AddLinkSet(linkSet *(map[string]Link), obj ModelObj) error {
	// Allocate the linkset if its nil
	if *linkSet == nil {
		*linkSet = make(map[string]Link)
	}

	// add the link to map
	(*linkSet)[obj.GetKey()] = Link{
		ObjType: obj.GetType(),
		ObjKey:  obj.GetKey(),
	}

	return nil
}
1243863
func (s *TapeArchive) SetPoolId(v string) *TapeArchive {
	s.PoolId = &v
	return s
}
698693
func restAddPool(w *rest.ResponseWriter, r *rest.Request, ctx *requestContext) {
	var payload pool.ResourcePool
	err := r.DecodeJsonPayload(&payload)
	if err != nil {
		glog.V(1).Info("Could not decode pool payload: ", err)
		restBadRequest(w, err)
		return
	}

	facade := ctx.getFacade()
	err = facade.AddResourcePool(ctx.getDatastoreContext(), &payload)
	if err != nil {
		glog.Error("Unable to add pool: ", err)
		restServerError(w, err)
		return
	}

	glog.V(0).Info("Added pool ", payload.ID)
	w.WriteJson(&simpleResponse{"Added resource pool", poolLinks(payload.ID)})
}
711740
func (b *RWSetBuilder) AddToPvtAndHashedWriteSet(ns string, coll string, key string, value []byte) {
	kvWrite, kvWriteHash := newPvtKVWriteAndHash(key, value)
	b.getOrCreateCollPvtRwBuilder(ns, coll).writeMap[key] = kvWrite
	b.getOrCreateCollHashedRwBuilder(ns, coll).writeMap[key] = kvWriteHash
}
295330
func returnToPool(slice []float32) {
	if cap(slice) == 0 {
		return
	}

	pool, exact := binLog(cap(slice))

	if !exact {
		panic("attempt to pool slice with non-exact cap. If you're a user, please file an issue with github.com/go-gl/mathgl about this bug. This should never happen.")
	}

	getPool(pool).Put(slice)
}
1082546
func AddCloudModelCounts(pool *StatePool) error {
	st := pool.SystemState()
	cloudsColl, closer := st.db().GetCollection(cloudsC)
	defer closer()

	var clouds []cloudDoc
	err := cloudsColl.Find(nil).All(&clouds)
	if err != nil {
		return errors.Trace(err)
	}

	modelsColl, closer := st.db().GetCollection(modelsC)
	defer closer()
	refCountColl, closer := st.db().GetCollection(globalRefcountsC)
	defer closer()

	var updateOps []txn.Op
	for _, c := range clouds {
		n, err := modelsColl.Find(bson.D{{"cloud", c.Name}}).Count()
		if err != nil {
			return errors.Trace(err)
		}
		_, currentCount, err := countCloudModelRefOp(st, c.Name)
		if err != nil {
			return errors.Trace(err)
		}
		if n != currentCount {
			op, err := nsRefcounts.CreateOrIncRefOp(refCountColl, cloudModelRefCountKey(c.Name), n-currentCount)
			if err != nil {
				return errors.Trace(err)
			}
			updateOps = append(updateOps, op)
		}
	}
	return st.db().RunTransaction(updateOps)
}
579080
func (b *RWSetBuilder) AddToMetadataWriteSet(ns, key string, metadata map[string][]byte) {
	b.getOrCreateNsPubRwBuilder(ns).
		metadataWriteMap[key] = mapToMetadataWrite(key, metadata)
}
45327
func AddStatusHistoryPruneSettings(pool *StatePool) error {
	st := pool.SystemState()
	err := applyToAllModelSettings(st, func(doc *settingsDoc) (bool, error) {
		settingsChanged :=
			maybeUpdateSettings(doc.Settings, config.MaxStatusHistoryAge, config.DefaultStatusHistoryAge)
		settingsChanged =
			maybeUpdateSettings(doc.Settings, config.MaxStatusHistorySize, config.DefaultStatusHistorySize) || settingsChanged
		return settingsChanged, nil
	})
	if err != nil {
		return errors.Trace(err)
	}
	return nil
}
781829
func (ts *TrustStore) Pool() *x509.CertPool {
	var pool = x509.NewCertPool()
	for _, cert := range ts.roots {
		pool.AddCert(cert)
	}
	return pool
}
615231
func (pool *LoadBalancedPool) SetActiveSetSize(size uint64) {
	pool.lock.Lock()
	defer pool.lock.Unlock()
	pool.activeSetSize = size
}
175950
func (g *Cloud) AddInstancesToTargetPool(name, region string, instanceRefs []*compute.InstanceReference) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()

	req := &compute.TargetPoolsAddInstanceRequest{
		Instances: instanceRefs,
	}
	mc := newTargetPoolMetricContext("add_instances", region)
	return mc.Observe(g.c.TargetPools().AddInstance(ctx, meta.RegionalKey(name, region), req))
}
542055
func (b *PeopleJSONBuilder) AddAll() *PeopleJSONBuilder {
	b._properties["ShowPrivateInfo"] = b.ShowPrivateInfo
	b._properties["List"] = b.List
	return b
}
1195997
func (sprite *sprite) AddAnimationSet(animationName string, set *AnimationSet) {
	simlog.FuncIn()
	sprite.animationSets[animationName] = set
	simlog.FuncOut()
}
1179494
func StartPool(pbs ...*ProgressBar) (pool *Pool, err error) {
	pool = new(Pool)
	if err = pool.Start(); err != nil {
		return
	}
	pool.Add(pbs...)
	return
}
900800
func (pool *ObjectPool) idleIterator() collections.Iterator {
	if pool.Config.LIFO {
		return pool.idleObjects.DescendingIterator()
	}
	return pool.idleObjects.Iterator()
}