# Functions
DoBatch request against a set of keys in the ring, handling replication and failures.
GetCodec returns the codec used to encode and decode data being put by ring.
GetInstanceAddr returns the address to use to register the instance in the ring.
GetInstancePort returns the port to use to register the instance in the ring.
HasReplicationSetChanged returns false if two replications sets are the same (with possibly different timestamps), true if they differ in any way (number of instances, instance states, tokens, zones, ...).
HasReplicationSetChangedWithoutState returns false if two replications sets are the same (with possibly different timestamps and instance states), true if they differ in any other way (number of instances, tokens, zones, ...).
MakeBuffersForGet returns buffers to use with Ring.Get().
MergeTokens takes in input multiple lists of tokens and returns a single list containing all tokens merged and sorted.
MergeTokensByZone is like MergeTokens but does it for each input zone.
New creates a new Ring.
NewBasicLifecycler makes a new BasicLifecycler.
NewDesc returns an empty ring.Desc.
NewLifecycler creates new Lifecycler.
NewNoopFlushTransferer makes a new NoopFlushTransferer.
NewOp constructs new Operation with given "healthy" states for operation, and optional function to extend replica set.
ProtoDescFactory makes new Descs.
WaitInstanceState waits until the input instanceID is registered within the ring matching the provided state.
WaitRingStability monitors the ring topology for the provided operation and waits until it keeps stable for at least minStability.
WaitRingTokensStability waits for the Ring to be unchanged at least for minStability time period, excluding transitioning between allowed states (e.g.
# Constants
Rings have different set of instances, or their information don't match.
Both rings contain same exact instances.
Both rings contain the same instances with the same data except states and timestamps (may differ).
GetBufferSize is the suggested size of buffers passed to Ring.Get().
GetZoneSize is the suggested size of zone map passed to Ring.Get().
This state is only used by gossiping code to distribute information about instances that have been removed from the ring.
# Variables
ErrEmptyRing is the error returned when trying to get an element when nothing has been added to hash.
ErrInconsistentTokensInfo is the error returned if, due to an internal bug, the mapping between a token and its own instance is missing or unknown.
ErrInstanceNotFound is the error returned when trying to get information for an instance not registered within the ring.
ErrTooManyUnhealthyInstances is the error returned when there are too many failed instances for a specific operation.
Read operation that extends the replica set if an instance is not ACTIVE, PENDING, LEAVING, JOINING OR READONLY.
Reporting is a special value for inquiring about health.
Write operation that also extends replica set, if instance state is not ACTIVE.
WriteNoExtend is like Write, but with no replicaset extension.
# Structs
AutoForgetDelegate automatically remove an instance from the ring if the last heartbeat is older than a configured period.
BasicLifecycler is a basic ring lifecycler which allows to hook custom logic at different stages of the lifecycle.
Config for a Ring.
Lifecycler is responsible for managing the lifecycle of entries in the ring.
LifecyclerConfig is the config to build a Lifecycler.
NoopFlushTransferer is a FlushTransferer which does nothing and can be used in cases we don't need one.
ReplicationSet describes the instances to talk to for a given key, and how many errors to tolerate.
Ring holds the information about the members of the consistent hash ring.
# Interfaces
FlushTransferer controls the shutdown of an instance in the ring.
ReadRing represents the read interface to the ring.
# Type aliases
ByAddr is a sortable list of InstanceDesc.
Operation describes which instances can be included in the replica set, based on their state.
Tokens is a simple list of tokens.
TokensHeap is an heap data structure used to merge multiple lists of sorted tokens into a single one.