// ZUnionStore unions the zsets and stores to dest zset.
178570
func (db *DB) ZUnionStore(destKey []byte, srcKeys [][]byte, weights []int64, aggregate byte) (int64, error) {

	var destMap = map[string]int64{}
	aggregateFunc := getAggregateFunc(aggregate)
	if aggregateFunc == nil {
		return 0, errInvalidAggregate
	}
	if len(srcKeys) < 1 {
		return 0, errInvalidSrcKeyNum
	}
	if weights != nil {
		if len(srcKeys) != len(weights) {
			return 0, errInvalidWeightNum
		}
	} else {
		weights = make([]int64, len(srcKeys))
		for i := 0; i < len(weights); i++ {
			weights[i] = 1
		}
	}

	for i, key := range srcKeys {
		scorePairs, err := db.ZRange(key, 0, -1)
		if err != nil {
			return 0, err
		}
		for _, pair := range scorePairs {
			if score, ok := destMap[hack.String(pair.Member)]; !ok {
				destMap[hack.String(pair.Member)] = pair.Score * weights[i]
			} else {
				destMap[hack.String(pair.Member)] = aggregateFunc(score, pair.Score*weights[i])
			}
		}
	}

	t := db.zsetBatch
	t.Lock()
	defer t.Unlock()

	db.zDelete(t, destKey)

	for member, score := range destMap {
		if err := checkZSetKMSize(destKey, []byte(member)); err != nil {
			return 0, err
		}

		if _, err := db.zSetItem(t, destKey, score, []byte(member)); err != nil {
			return 0, err
		}
	}

	var n = int64(len(destMap))
	sk := db.zEncodeSizeKey(destKey)
	t.Put(sk, PutInt64(n))

	if err := t.Commit(); err != nil {
		return 0, err
	}
	return n, nil
}
242183
func (s *OnboardingService) IsOnboarding(ctx context.Context) (bool, error) {
	return s.IsOnboardingFn(ctx)
}
1221292
func (m _Map_String_Bonk_Zapper) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	for k, v := range m {
		err = multierr.Append(err, enc.AddObject((string)(k), v))
	}
	return err
}
73092
func (v *GenerateServiceRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	err = multierr.Append(err, enc.AddArray("rootServices", (_List_ServiceID_Zapper)(v.RootServices)))
	err = multierr.Append(err, enc.AddArray("services", (_Map_ServiceID_Service_Zapper)(v.Services)))
	err = multierr.Append(err, enc.AddArray("modules", (_Map_ModuleID_Module_Zapper)(v.Modules)))
	enc.AddString("packagePrefix", v.PackagePrefix)
	enc.AddString("thriftRoot", v.ThriftRoot)
	return err
}
762378
func (l _List_I32_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		enc.AppendInt32(v)
	}
	return err
}
1109423
func (m _Map_I32_Set_String_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for k, v := range m {
		err = multierr.Append(err, enc.AppendObject(_Map_I32_Set_String_Item_Zapper{Key: k, Value: v}))
	}
	return err
}
1161346
func (v *Bonk) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Message != nil {
		enc.AddString("message", *v.Message)
	}
	if v.Type != nil {
		enc.AddInt32("type", *v.Type)
	}
	return err
}
583119
func (v *Type) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.SimpleType != nil {
		err = multierr.Append(err, enc.AddObject("simpleType", *v.SimpleType))
	}
	if v.SliceType != nil {
		err = multierr.Append(err, enc.AddObject("sliceType", v.SliceType))
	}
	if v.KeyValueSliceType != nil {
		err = multierr.Append(err, enc.AddObject("keyValueSliceType", v.KeyValueSliceType))
	}
	if v.MapType != nil {
		err = multierr.Append(err, enc.AddObject("mapType", v.MapType))
	}
	if v.ReferenceType != nil {
		err = multierr.Append(err, enc.AddObject("referenceType", v.ReferenceType))
	}
	if v.PointerType != nil {
		err = multierr.Append(err, enc.AddObject("pointerType", v.PointerType))
	}
	return err
}
1081371
func (v *GenerateServiceResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Files != nil {
		err = multierr.Append(err, enc.AddObject("files", (_Map_String_Binary_Zapper)(v.Files)))
	}
	return err
}
1283429
func (p *peerGroupChanges) initNewReplicaSet() map[string]*replicaset.Member {
	rs := make(map[string]*replicaset.Member, len(p.info.recognised))
	for id := range p.info.recognised {
		// Local-scoped variable required here,
		// or the same pointer to the loop variable is used each time.
		m := p.info.recognised[id]
		rs[id] = &m
	}
	return rs
}
221356
func (n *NodeInfo) SetAllocatableResource(allocatableResource *Resource) {
	n.allocatableResource = allocatableResource
	n.generation = nextGeneration()
}
1249487
func (s _Set_I32_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for v := range s {
		enc.AppendInt32(v)
	}
	return err
}
1321265
func (v *NestedListsBonk) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Bonk != nil {
		err = multierr.Append(err, enc.AddArray("bonk", (_List_List_List_Bonk_Zapper)(v.Bonk)))
	}
	return err
}
227330
func (m _Map_I32_I32_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for k, v := range m {
		err = multierr.Append(err, enc.AppendObject(_Map_I32_I32_Item_Zapper{Key: k, Value: v}))
	}
	return err
}
252960
func (s *Factory) DaemonSets() typesappsv1beta2.DaemonSetInterface {
	return s.appsClientSet.DaemonSets(s.namespace)
}
261825
func (v _Map_ModuleID_Module_Item_Zapper) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	enc.AddInt32("key", (int32)(v.Key))
	err = multierr.Append(err, enc.AddObject("value", v.Value))
	return err
}
695477
func checkNoZap(g Generator) bool {
	if gen, ok := g.(*generator); ok {
		return gen.noZap
	}
	return false
}