package
0.100.0
Repository: https://github.com/gazette/core.git
Documentation: pkg.go.dev

# Packages

Package sparse_push_relabel implements a greedy variant of the push/relabel algorithm.

# Functions

Allocate observes the Allocator KeySpace, and if this Allocator instance is the current leader, performs reactive scheduling rounds to maintain the allocation of all Items to Members.
Announce a key and value to etcd under the LeaseID, asserting the key doesn't already exist.
AssignmentKey returns the unique key for Assignment |assignment| under the KeySpace.
ItemAssignmentsPrefix returns the unique key prefix for all Assignments of |itemID| under the KeySpace.
ItemKey returns the unique key for an Item with ID |id| under the KeySpace.
LookupItem returns the identified Item, or false if not found.
LookupMember returns the identified Member, or false if not found.
MemberKey returns the unique key for a Member with |zone| and |suffix| under the KeySpace.
NewAllocatorKeySpace is a convenience for `NewKeySpace(prefix, NewAllocatorKeyValueDecoder(prefix, decode))`.
NewAllocatorKeyValueDecoder returns a KeyValueDecoder utilizing the supplied Decoder, and suitable for use with NewKeySpace of the same |prefix|.
NewObservedState returns a *State instance which extracts and updates itself from the provided KeySpace, pivoted around the Member instance identified by |localKey|.
StartSession starts an allocator session.

# Constants

AssignmentsPrefix prefixes Assignment keys, eg "root/assign/item-id#zone#member-suffix#slot".
ItemsPrefix prefixes Item keys, eg "root/items/id".
MembersPrefix prefixes Member keys, eg "root/members/zone#suffix".
'#' is selected as separator, because it's the first visual ASCII character which is not interpreted by shells (preceding visual characters are " and !).
'#' is selected as separator, because it's the first visual ASCII character which is not interpreted by shells (preceding visual characters are " and !).

# Structs

No description provided by the author
Announcement manages a unique key which is "announced" to peers through Etcd, with an associated lease and a value which may be updated over time.
Assignment composes an Assignment ItemID, MemberZone, MemberSuffix & Slot with its user-defined AssignmentValue.
Item composes an Item ID with its user-defined ItemValue.
LeftJoin performs a Left join of two comparable, index-able, and ordered collections.
LeftJoinCursor is a LeftJoin result row, relating a |Left| index with a [RightBegin, RightEnd) range of indices comparing as equal.
LocalItem represents an Item which is assigned to the local Allocator.
Member composes a Member Zone & Suffix with its user-defined MemberValue.
SessionArgs are arguments of StartSession.
State is an extracted representation of the allocator KeySpace.

# Interfaces

AssignmentValue is a user-defined Assignment representation.
Decoder decodes "raw" Etcd values of Items, Members, and Assignments into their user-defined representations.
ItemValue is a user-defined Item representation which also supports required APIs for use by Allocator.
MemberValue is a user-defined Member representation which also supports required APIs for use by Allocator.

# Type aliases

IsConsistentFn is a free function which determines whether the Item is to be considered "consistent" given its current AssignmentValue and the set of all AssignmentValues of the Item.