cockroach: Index | Files

package enum

import ""


Package Files


func GenByteStringBetween Uses

func GenByteStringBetween(prev []byte, next []byte, spacing ByteSpacing) []byte

GenByteStringBetween generates a byte string that sorts between the two input strings. If prev is length 0, it is treated as negative infinity. If next is length 0, it is treated as positive infinity. Importantly, the input strings cannot end with minToken.

func GenerateNEvenlySpacedBytes Uses

func GenerateNEvenlySpacedBytes(n int) [][]byte

GenerateNEvenlySpacedBytes returns an array of n byte slices that evenly split the key space into n pieces.

type ByteSpacing Uses

type ByteSpacing int

ByteSpacing is a type that controls what distribution of generated bytes strings is created with calls to GenByteStringBetween.

const (
    // PackedSpacing is used when the generated bytes are intended to be "close"
    // together in the generated key space.
    PackedSpacing ByteSpacing = iota
    // SpreadSpacing is used when the generated bytes are intended to be evenly
    // spaced out within the generated key space.

func (ByteSpacing) String Uses

func (s ByteSpacing) String() string

Package enum imports 1 packages (graph) and is imported by 1 packages. Updated 2020-07-06. Refresh now. Tools for package owners.