// AddToUnit validates and creates additional storage instances for units.
// A "CHANGE" block can block this operation.
424477
func (a *StorageAPIv3) AddToUnit(args params.StoragesAddParams) (params.ErrorResults, error) {
	v4results, err := a.addToUnit(args)
	if err != nil {
		return params.ErrorResults{}, err
	}
	v3results := make([]params.ErrorResult, len(v4results.Results))
	for i, result := range v4results.Results {
		v3results[i].Error = result.Error
	}
	return params.ErrorResults{v3results}, nil
}
1249812
func (l *Changes) AddRecursiveInsert(root noder.Path) error {
	return l.addRecursive(root, NewInsert)
}
462034
func (set IdentifierSet) Add(i Identifier) bool {
	_, found := set[i]
	set[i] = struct{}{}
	return !found //False if it existed already
}
1086127
func (p *PodSyncResult) AddSyncResult(result ...*SyncResult) {
	p.SyncResults = append(p.SyncResults, result...)
}
855894
func (g *Mutable) AddBothCost(v, w int, c int64) {
	g.AddCost(v, w, c)
	if v != w {
		g.AddCost(w, v, c)
	}
}
148351
func (f *MinhashLSH) Add(key interface{}, sig []uint64) {
	// Generate hash keys
	Hs := make([]string, f.l)
	for i := 0; i < f.l; i++ {
		Hs[i] = f.hashKeyFunc(sig[i*f.k : (i+1)*f.k])
	}
	// Insert keys into the bootstrapping tables
	for i := range f.initHashTables {
		func(ht initHashTable, hk string, key interface{}) {
			if _, exist := ht[hk]; exist {
				ht[hk] = append(ht[hk], key)
			} else {
				ht[hk] = make(keys, 1)
				ht[hk][0] = key
			}
		}(f.initHashTables[i], Hs[i], key)
	}
}
729525
func (i *Uint32) Add(n uint32) uint32 {
	return atomic.AddUint32(&i.v, n)
}
187254
func NewNonTS(items ...interface{}) *SetNonTS {
	s := &SetNonTS{}
	s.m = make(map[interface{}]struct{})

	// Ensure interface compliance
	var _ Interface = s

	s.Add(items...)
	return s
}
107464
func AddStateInstance(stor storage.Storage, id instance.Id) error {
	state, err := LoadState(stor)
	if err == environs.ErrNotBootstrapped {
		state = &BootstrapState{}
	} else if err != nil {
		return errors.Annotate(err, "cannot record state instance-id")
	}
	state.StateInstances = append(state.StateInstances, id)
	return SaveState(stor, state)
}
537693
func (i IntCounter) Add(key int) (changed bool) {
	value, exists := i[key]
	if !exists {
		changed = true
	}
	i[key] = value + 1
	return changed
}
207454
func (c *Controller) addToBin(ntfr *notifier, address []byte) (symKeyId string, pssAddress pss.PssAddress, err error) {

	// parse the address from the message and truncate if longer than our bins threshold
	if len(address) > ntfr.threshold {
		address = address[:ntfr.threshold]
	}

	pssAddress = pss.PssAddress(address)
	hexAddress := fmt.Sprintf("%x", address)
	currentBin, ok := ntfr.bins[hexAddress]
	if ok {
		currentBin.count++
		symKeyId = currentBin.symKeyId
	} else {
		symKeyId, err = c.pss.GenerateSymmetricKey(ntfr.topic, pssAddress, false)
		if err != nil {
			return "", nil, err
		}
		ntfr.bins[hexAddress] = &sendBin{
			address:  address,
			symKeyId: symKeyId,
			count:    1,
		}
	}
	return symKeyId, pssAddress, nil
}
389572
func (s *Storage) AddIosError(count int64) {
	atomic.AddInt64(&s.stat.Ios.PushError, count)
}
1086701
func (s0 Span) Add(s1 Span) Span {
	return toIntern(toExtern(s0).Add(toExtern(s1)))
}
732029
func (s *Storage) Init() error {
	s.name = "badger"
	s.opts = badger.DefaultOptions
	s.opts.Dir = os.TempDir() + "badger"
	s.opts.ValueDir = os.TempDir() + "badger"
	return nil
}
201669
func (c *MockStore) Add(cwr *ChunkWriteRequest) {
	if !c.Drop {
		intervalHint := cwr.Key.Archive.Span()
		itgen, err := chunk.NewIterGen(cwr.Chunk.Series.T0, intervalHint, cwr.Chunk.Encode(cwr.Span))
		if err != nil {
			panic(err)
		}
		c.results[cwr.Key] = append(c.results[cwr.Key], itgen)
		c.items++
	}
}
415448
func (enc *Encoder) AddIntKeyNullEmpty(key string, v int) {
	enc.IntKeyNullEmpty(key, v)
}
1012991
func (b *Bucket) AddWithMT(k string, exp int, v interface{}) (added bool, mt *MutationToken, err error) {
	mt, err = b.WriteWithMT(k, 0, exp, v, AddOnly)
	if err == ErrKeyExists {
		return false, mt, nil
	}
	return (err == nil), mt, err
}