Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( LocalIP string MinWriteAbleDataPartitionCnt = 10 )
Functions ¶
This section is empty.
Types ¶
type DataPartition ¶
type DataPartition struct { // Will not be changed proto.DataPartitionResponse RandomWrite bool PartitionType string Metrics *DataPartitionMetrics }
DataPartition defines the wrapper of the data partition.
func (*DataPartition) CheckAllHostsIsAvail ¶ added in v1.4.0
func (dp *DataPartition) CheckAllHostsIsAvail(exclude map[string]struct{})
func (*DataPartition) GetAllAddrs ¶
func (dp *DataPartition) GetAllAddrs() string
GetAllAddrs returns the addresses of all the replicas of the data partition.
func (*DataPartition) String ¶
func (dp *DataPartition) String() string
String returns the string format of the data partition.
type DataPartitionMetrics ¶
DataPartitionMetrics defines the wrapper of the metrics related to the data partition.
func NewDataPartitionMetrics ¶
func NewDataPartitionMetrics() *DataPartitionMetrics
NewDataPartitionMetrics returns a new DataPartitionMetrics instance.
type DataPartitionSorter ¶
type DataPartitionSorter []*DataPartition
func (DataPartitionSorter) Len ¶
func (ds DataPartitionSorter) Len() int
func (DataPartitionSorter) Less ¶
func (ds DataPartitionSorter) Less(i, j int) bool
func (DataPartitionSorter) Swap ¶
func (ds DataPartitionSorter) Swap(i, j int)
type DataPartitionView ¶
type DataPartitionView struct {
DataPartitions []*DataPartition
}
type Wrapper ¶
Wrapper TODO rename. This name does not reflect what it is doing.
func NewDataPartitionWrapper ¶
NewDataPartitionWrapper returns a new data partition wrapper.
func (*Wrapper) FollowerRead ¶ added in v1.4.0
func (*Wrapper) GetDataPartition ¶
func (w *Wrapper) GetDataPartition(partitionID uint64) (*DataPartition, error)
GetDataPartition returns the data partition based on the given partition ID.
func (*Wrapper) GetDataPartitionForWrite ¶
func (w *Wrapper) GetDataPartitionForWrite(exclude map[string]struct{}) (*DataPartition, error)
GetDataPartitionForWrite returns an available data partition for write.
func (*Wrapper) WarningMsg ¶
WarningMsg returns the warning message that contains the cluster name.