Ejemplo n.º 1
0
// SequenceCacheKey returns a range-local key by Range ID for a
// sequence cache entry, with detail specified by encoding the
// supplied transaction ID, epoch and sequence number.
func SequenceCacheKey(rangeID roachpb.RangeID, id []byte, epoch uint32, seq uint32) roachpb.Key {
	return MakeRangeIDKey(rangeID, LocalSequenceCacheSuffix,
		encoding.EncodeUint32Descending(
			encoding.EncodeUint32Descending(
				encoding.EncodeBytesAscending(nil, id),
				epoch),
			seq))
}
Ejemplo n.º 2
0
// SequenceCacheKey returns a range-local key by Range ID for a
// sequence cache entry, with detail specified by encoding the
// supplied transaction ID, epoch and sequence number.
func SequenceCacheKey(rangeID roachpb.RangeID, txnID *uuid.UUID, epoch uint32, seq uint32) roachpb.Key {
	key := SequenceCacheKeyPrefix(rangeID, txnID)
	key = encoding.EncodeUint32Descending(key, epoch)
	key = encoding.EncodeUint32Descending(key, seq)
	return key
}
Ejemplo n.º 3
0
// SequenceCacheKey returns a range-local key by Range ID for a
// sequence cache entry, with detail specified by encoding the
// supplied transaction ID, epoch and sequence number.
func SequenceCacheKey(rangeID roachpb.RangeID, id []byte, epoch uint32, seq uint32) roachpb.Key {
	key := SequenceCacheKeyPrefix(rangeID, id)
	key = encoding.EncodeUint32Descending(key, epoch)
	key = encoding.EncodeUint32Descending(key, seq)
	return key
}