Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Assigner ¶
type Assigner struct {
// contains filtered or unexported fields
}
Assigner maintains hosts and their assignments.
func (*Assigner) Assignments ¶
type HostAssignments ¶
type HostAssignments struct {
// contains filtered or unexported fields
}
HostAssignments stores hosts and their corresponding ranges of hash values. Each host gets a set of key ranges that it owns. This struct handles building, validating and querying those slice ranges.
func NewFromSerialized ¶
func NewFromSerialized(r io.Reader) (*HostAssignments, error)
func NewHostAssignments ¶
func NewHostAssignments(assignments map[string][]Range) (*HostAssignments, error)
NewHostAssignments will create a new HostAssignments from a complete set of assignments. If the assignment ranges are not complete, or are overlapping, this function will return an error.
func (*HostAssignments) Assignments ¶
func (hm *HostAssignments) Assignments() map[string][]Range
Assignments returns a full copy of the internal assignments.
func (*HostAssignments) GetHost ¶
func (hm *HostAssignments) GetHost(key string) string
GetHost get a host's identifier for a given key.
func (*HostAssignments) NewAssignments ¶
func (hm *HostAssignments) NewAssignments(assignments map[string][]Range) error
NewAssignments takes a new set of assignments. If the assignment ranges are not complete, or are overlapping, this function will return an error.