cluster

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

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

func NewKubeMeta(level int) (*KubeMeta, error)

NewKubeMeta creates a KubeMeta with given logging level.

func (*KubeMeta) NodeIDNil

func (km *KubeMeta) NodeIDNil() int32

NodeIDNil returns the nil value of node id.

func (*KubeMeta) NodeIDSelf

func (km *KubeMeta) NodeIDSelf() int32

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) Size

func (km *KubeMeta) Size() int32

Size returns the number of nodes in the cluster.

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.

func (*KubeMeta) String

func (km *KubeMeta) String() string

String returns a string representation of the KubeMeta.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL