Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoPartitionDataAvailableYet is returned by the SRV-aware // partition detector to indicate that SRV records for this target // application are not yet available. ErrNoPartitionDataAvailableYet = xerrors.Errorf("no partition data available yet") )
Functions ¶
This section is empty.
Types ¶
type Detector ¶
Detector is implemented by types that can assign a clustered application instance to a particular partition.
type Fixed ¶
type Fixed struct { // The assigned partition number. Partition int // The number of partitions. NumPartitions int }
Fixed is a dummy PartitionDetector implementation that always returns back the same partition details.
type FromSRVRecords ¶
type FromSRVRecords struct {
// contains filtered or unexported fields
}
FromSRVRecords detects the number of partitions by performing an SRV query and counting the number of results.
func DetectFromSRVRecords ¶
func DetectFromSRVRecords(srvName string) FromSRVRecords
DetectFromSRVRecords returns a PartitionDetector implementation that extracts the current partition name from the current host name and attempts to detect the total number of partitions by performing an SRV query and counting the number of responses.
This detector is meant to be used in conjunction with a Stateful Set in a kubernetes environment.
func (FromSRVRecords) PartitionInfo ¶
func (det FromSRVRecords) PartitionInfo() (int, int, error)
PartitionInfo implements PartitionDetector.
type Range ¶
type Range struct {
// contains filtered or unexported fields
}
Range represents a contiguous UUID region which is split into a number of partitions.
func NewFullRange ¶
NewFullRange creates a new range that uses the full UUID value space and splits it into the provided number of partitions.