// generatePrefix creates the key prefix for the given priority level.
7986
func (pq *PriorityQueue) generatePrefix(level uint8) []byte {
	// priority + prefixSep = 1 + 1 = 2
	prefix := make([]byte, 2)
	prefix[0] = byte(level)
	prefix[1] = prefixSep[0]
	return prefix
}
517533
func (c *consulClient) GetPrefix(ctx context.Context, prefix string) (string, []byte, error) {
	duration := spanstat.Start()
	opts := &consulAPI.QueryOptions{}
	pairs, _, err := c.KV().List(prefix, opts.WithContext(ctx))
	increaseMetric(prefix, metricRead, "GetPrefix", duration.EndError(err).Total(), err)
	if err != nil {
		return "", nil, err
	}

	if len(pairs) == 0 {
		return "", nil, nil
	}

	return pairs[0].Key, pairs[0].Value, nil
}
446543
func (s *ListMultipartUploadsInput) SetPrefix(v string) *ListMultipartUploadsInput {
	s.Prefix = &v
	return s
}
274810
func (s *S3ResourceClassificationUpdate) SetPrefix(v string) *S3ResourceClassificationUpdate {
	s.Prefix = &v
	return s
}
1307842
func generateKeyPrefixID(prefix []byte, id uint64) []byte {
	// Handle the prefix.
	key := append(prefix, prefixDelimiter)

	// Handle the item ID.
	key = append(key, idToKey(id)...)

	return key
}
690506
func (s *SubDomainSetting) SetPrefix(v string) *SubDomainSetting {
	s.Prefix = &v
	return s
}
1272363
func (h *Handle) KeyPrefix() []string {
	h.Lock()
	defer h.Unlock()
	return []string{h.app}
}
661485
func (a *Array) IPPrefix(pfx net.IPNet) *Array {
	a.buf = enc.AppendIPPrefix(enc.AppendArrayDelim(a.buf), pfx)
	return a
}
680690
func IteratePrefix(db DB, prefix []byte) Iterator {
	var start, end []byte
	if len(prefix) == 0 {
		start = nil
		end = nil
	} else {
		start = cp(prefix)
		end = cpIncr(prefix)
	}
	return db.Iterator(start, end)
}
192220
func DelKeyWithPrefix(rm kv.RetrieverMutator, prefix kv.Key) error {
	var keys []kv.Key
	iter, err := rm.Iter(prefix, prefix.PrefixNext())
	if err != nil {
		return errors.Trace(err)
	}

	defer iter.Close()
	for {
		if err != nil {
			return errors.Trace(err)
		}

		if iter.Valid() && iter.Key().HasPrefix(prefix) {
			keys = append(keys, iter.Key().Clone())
			err = iter.Next()
			if err != nil {
				return errors.Trace(err)
			}
		} else {
			break
		}
	}

	for _, key := range keys {
		err := rm.Delete(key)
		if err != nil {
			return errors.Trace(err)
		}
	}

	return nil
}
488810
func (s *MetricsFilter) SetPrefix(v string) *MetricsFilter {
	s.Prefix = &v
	return s
}
244812
func (ref Ref) ConstantPrefix() Ref {
	ref = ref.Copy()

	i := ref.Dynamic()
	if i < 0 {
		return ref
	}
	return ref[:i]
}
339394
func (r *Receiver) SetPrefix(prefix string) {
	if prefix != "" && !strings.HasSuffix(prefix, " ") {
		prefix += " "
	}
	r.logger.SetPrefix(prefix)
}
1305738
func (s *ResourceDataSyncS3Destination) SetPrefix(v string) *ResourceDataSyncS3Destination {
	s.Prefix = &v
	return s
}
1168281
func (s *ReplicationRuleFilter) SetPrefix(v string) *ReplicationRuleFilter {
	s.Prefix = &v
	return s
}
660231
func (s *HttpRouteMatch) SetPrefix(v string) *HttpRouteMatch {
	s.Prefix = &v
	return s
}
603843
func (s *ReplicationRule) SetPrefix(v string) *ReplicationRule {
	s.Prefix = &v
	return s
}