// Add adds a namespace-collection tuple to the filter
435273
func (filter PvtNsCollFilter) Add(ns string, coll string) {
	collFilter, ok := filter[ns]
	if !ok {
		collFilter = make(map[string]bool)
		filter[ns] = collFilter
	}
	collFilter[coll] = true
}
1251865
func (t *awsTagging) addFilters(filters []*ec2.Filter) []*ec2.Filter {
	// if there are no clusterID configured - no filtering by special tag names
	// should be applied to revert to legacy behaviour.
	if len(t.ClusterID) == 0 {
		if len(filters) == 0 {
			// We can't pass a zero-length Filters to AWS (it's an error)
			// So if we end up with no filters; just return nil
			return nil
		}
		return filters
	}
	// For 1.6, we always recognize the legacy tag, for the 1.5 -> 1.6 upgrade
	// There are no "or" filters by key, so we look for both the legacy and new key, and then we have to post-filter
	f := newEc2Filter("tag-key", TagNameKubernetesClusterLegacy, t.clusterTagKey())

	// We can't pass a zero-length Filters to AWS (it's an error)
	// So if we end up with no filters; we need to return nil
	filters = append(filters, f)
	return filters
}
1093996
func (eng *Engine) Add(name string, value interface{}, tags ...Tag) {
	eng.measure(time.Now(), name, value, Counter, tags...)
}
932798
func (g *GIFT) Add(filters ...Filter) {
	g.Filters = append(g.Filters, filters...)
}
359170
func (set *Set) Add(items ...interface{}) {
	set.lock.Lock()
	defer set.lock.Unlock()

	set.flattened = nil
	for _, item := range items {
		set.items[item] = struct{}{}
	}
}
311392
func (p *MemPostings) Add(id uint64, lset labels.Labels) {
	p.mtx.Lock()

	for _, l := range lset {
		p.addFor(id, l)
	}
	p.addFor(id, allPostingsKey)

	p.mtx.Unlock()
}
311375
func (c *Columns) Add(names ...string) []*Column {
	var ret []*Column
	c.lock.Lock()

	tableAlias := c.TableAlias
	if tableAlias == "" {
		tableAlias = c.TableName
	}

	for _, name := range names {

		var xs []string
		var col *Column
		ss := ""
		//support for distinct xx, or distinct on (field) table.fields
		if strings.HasSuffix(name, ",r") || strings.HasSuffix(name, ",w") {
			xs = []string{name[0 : len(name)-2], name[len(name)-1:]}
		} else {
			xs = []string{name}
		}

		xs[0] = strings.TrimSpace(xs[0])
		//eg: id id2 - select id as id2
		// also distinct columnname
		// and distinct on (column1) column2
		if strings.Contains(strings.ToUpper(xs[0]), " AS ") {
			//eg: select id as id2
			i := strings.LastIndex(strings.ToUpper(xs[0]), " AS ")
			ss = xs[0]
			xs[0] = xs[0][i+4 : len(xs[0])] //get id2
		} else if strings.Contains(xs[0], " ") {
			i := strings.LastIndex(name, " ")
			ss = xs[0]
			xs[0] = xs[0][i+1 : len(xs[0])] //get id2
		}

		col = c.Cols[xs[0]]
		if col == nil {
			if ss == "" {
				ss = xs[0]
				if tableAlias != "" {
					ss = fmt.Sprintf("%s.%s", tableAlias, ss)
				}
			}

			col = &Column{
				Name:      xs[0],
				SelectSQL: ss,
				Readable:  true,
				Writeable: true,
			}

			if len(xs) > 1 {
				if xs[1] == "r" {
					col.Writeable = false
				} else if xs[1] == "w" {
					col.Readable = false
				}
			} else if col.Name == "id" {
				col.Writeable = false
			}

			c.Cols[col.Name] = col
		}
		ret = append(ret, col)
	}

	c.lock.Unlock()
	return ret
}
1184393
func (s *set) Add(vs ...interface{}) {
	for _, v := range vs {
		s.values[v] = struct{}{}
	}
}
865750
func (s *ScalableBloomFilter) Add(data []byte) Filter {
	idx := len(s.filters) - 1

	// If the last filter has reached its fill ratio, add a new one.
	if s.filters[idx].EstimatedFillRatio() >= s.p {
		s.addFilter()
		idx++
	}

	s.filters[idx].Add(data)
	return s
}
1297043
func (l *Limiter) Add(name string, cap int, period time.Duration) *Bucket {
	l.m.Lock()
	defer l.m.Unlock()
	if _, ok := l.buckets[name]; !ok {
		l.buckets[name] = newBucket(cap, period)
	}
	return l.buckets[name]
}
156116
func FilterNamespace(info *Info, err error) error {
	if err != nil {
		return err
	}
	if !info.Namespaced() {
		info.Namespace = ""
		UpdateObjectNamespace(info, nil)
	}
	return nil
}
88283
func (t *Templates) Add(src string) error {
	if _, err := t.parsed.Parse(src); err != nil {
		return err
	}
	return nil
}
863208
func (t *Manager) Add(api Definition) (err error) {
	if api.Name == "" || api.FullName == "" {
		name, fullname := t.NameGenerator(t, api)
		if api.Name == "" {
			api.Name = name
		}
		if api.FullName == "" {
			api.FullName = fullname
		}
	}
	if api.Method == "" {
		api.Method = t.MethodGenerator(t, api)
	}
	if api.Pattern == "" {
		api.Pattern = t.PatternGenerator(t, api)
	}
	key := t.GetMethodPatternKey(t, api)
	if _, exist := t.apiMethodPatternMap[key]; exist {
		return ErrorAPIRegisted2.New(nil, api.Method, api.Pattern)
	}
	t.apiMethodPatternMap[key] = api
	return
}
389313
func (l builtList) Add(name string) builtList {
	if l == nil {
		return builtList{name: 0}
	}
	l[name] = len(l)
	return l
}
1177716
func (f *Float64) Add(s float64) float64 {
	for {
		old := f.Load()
		new := old + s
		if f.CAS(old, new) {
			return new
		}
	}
}
739627
func (r *Request) AddFilter(key string, value interface{}) *Request {
	if r.Filter == nil {
		r.Filter = map[string]interface{}{}
	}
	r.Filter[key] = value
	return r
}
436663
func (mtt *mttNode) Add(mt *metricType) {
	ns := mt.Namespace()
	node, index := mtt.walk(ns.Strings())
	if index == len(ns) {
		if node.mts == nil {
			node.mts = make(map[int]*metricType)
		}
		node.mts[mt.Version()] = mt
		return
	}
	// walk through the remaining namespace and build out the
	// new branch in the trie.
	for _, n := range ns[index:] {
		if node.children == nil {
			node.children = make(map[string]*mttNode)
		}
		node.children[n.Value] = &mttNode{}
		node = node.children[n.Value]
	}
	node.mts = make(map[int]*metricType)
	node.mts[mt.Version()] = mt
}