package
Version:
v0.0.0-...-6206b6d
Opens a new window with list of versions in this module.
Published: Nov 4, 2021
License: MIT
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
NextBallot generates next ballot number given current ballot bumber and node idservice
Ballot is ballot number type combines 32 bits of natual number and 32 bits of node idservice into uint64
NewBallot generates ballot number in format <n, zone, node>
NodeId return node idservice as last 32 bits of ballot
N returns first 32 bit of ballot
Next generates the next ballot number given node idservice
NodeId represents a generic identifier in format of Zone.Node
func LeaderID(ballot int) ID
LeaderID return the node idservice from ballot number
func NewID(zone, node int) ID
NewID returns a new NodeId type given two int number of zone and node
Node returns Node NodeId component
Zone returns Zone NodeId component
type Policy interface {
Hit(id ID) ID
}
Policy defines a trigger for data access patterns, that can be used in data migration protocols
NewPolicy returns the policy by policy name from config
Source Files
¶
Click to show internal directories.
Click to hide internal directories.