Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckReplica ¶
func CheckReplica(shardConfigs []*ShardConfig, expectedReplica uint) bool
Types ¶
type ShardConfig ¶
func (*ShardConfig) IsValid ¶
func (config *ShardConfig) IsValid() bool
type ShardedNode ¶
type ShardedNode struct { URL string `json:"url"` Config ShardConfig `json:"config"` // Latency RPC latency in milli seconds. Latency int64 `json:"latency"` // Since last updated timestamp. Since int64 `json:"since"` }
func Select ¶
func Select(nodes []*ShardedNode, expectedReplica uint, random bool) ([]*ShardedNode, bool)
select a set of given sharded node and make the data is replicated at least expctedReplica times return the selected nodes and if selection is successful
Click to show internal directories.
Click to hide internal directories.