Documentation ¶
Overview ¶
Package cluster provides methods to get cluster information.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KubeMeta ¶
type KubeMeta struct {
// contains filtered or unexported fields
}
KubeMeta implements Meta interface for a kubernetes cluster. An example of cluster config can be found at kubernetes/rawkv.yaml.
func NewKubeMeta ¶
NewKubeMeta creates a KubeMeta with given logging level.
func (*KubeMeta) NodeIDSelf ¶
NodeIDSelf returns the id of current node.
func (*KubeMeta) RaftClient ¶
func (km *KubeMeta) RaftClient(id int32) pb.RaftClient
RaftClient returns the raft grpc client to communicate with the node with given id.
func (*KubeMeta) StorageClient ¶
func (km *KubeMeta) StorageClient(id int32) pb.StorageClient
StorageClient returns the storage grpc client to communicate with the node with given id.
type Meta ¶
type Meta interface { // NodeIDNil returns the nil value of node id. NodeIDNil() int32 // NodeIDSelf returns the id of current node. NodeIDSelf() int32 // Size returns the number of nodes in the cluster. Size() int32 // StorageClient returns the storage grpc client to communicate with the node with given id. StorageClient(id int32) pb.StorageClient // RaftClient returns the raft grpc client to communicate with the node with given id. RaftClient(id int32) pb.RaftClient }
Meta provides information of nodes in a cluster.
Click to show internal directories.
Click to hide internal directories.