Documentation
¶
Index ¶
Constants ¶
const ( BeginningToEnd = "beginingToEnd" EndToBegining = "endToBegining" )
Variables ¶
var ErrGapSizeToLargeForObjectCount = fmt.Errorf("minGapSize is too large for objectCount")
var ErrRankFormatInvalid = fmt.Errorf("rank format is invalid")
var MaxBucketValue = 2
MaxBucketValue is the maximum value a bucket can be before it wraps around to 0, default is 2
Functions ¶
func DissectRank ¶
DissectRank is a helper function which takes a rank and returns the bucket and id of the rank
func Next ¶
Next returns the next rank in the lexorank space
currentMaxRank is the current maximum rank in the set
longestRank is the highest length in the set, (not highest rank, but highest len(rank)) this is required do to our usage of appending I's to the end of values to avoid collisions. It allows us to pad the max rank to the correct value before we start calculating the next rank
stepSize is the number of steps to take to get to the next rank (we have no way to evenly distribute the ranks so we have to use a step size)
Types ¶
type Direction ¶
type Direction string
Direction is the direction of movement for reindexing through the set. Whether it's going from begining to end or end to begining will matter based on which bucket we are moving to
type Indexer ¶
type Indexer struct {
// contains filtered or unexported fields
}
Indexer is a lexorank index generator for reindexing objects to ensure they are spread throughout the lexorank space
func NewIndexer ¶
NewIndexer creates a new indexer for reindexing objects in the lexorank space