master

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoValidMaster = errors.New("no valid master")
)

Functions

This section is empty.

Types

type AdminAPI

type AdminAPI struct {
	// contains filtered or unexported fields
}

func (*AdminAPI) AddDataReplica

func (api *AdminAPI) AddDataReplica(dataPartitionID uint64, nodeAddr string) (err error)

func (*AdminAPI) CreateDataPartition

func (api *AdminAPI) CreateDataPartition(volName string, count int) (err error)

func (*AdminAPI) CreateMetaPartition

func (api *AdminAPI) CreateMetaPartition(volName string, inodeStart uint64) (err error)

func (*AdminAPI) CreateVolume

func (api *AdminAPI) CreateVolume(volName, owner string, mpCount int,
	dpSize uint64, capacity uint64, replicas int, followerRead bool) (err error)

func (*AdminAPI) DecommissionDataPartition

func (api *AdminAPI) DecommissionDataPartition(dataPartitionID uint64, nodeAddr string) (err error)

func (*AdminAPI) DeleteDataReplica

func (api *AdminAPI) DeleteDataReplica(dataPartitionID uint64, nodeAddr string) (err error)

func (*AdminAPI) DeleteVolume

func (api *AdminAPI) DeleteVolume(volName, authKey string) (err error)

func (*AdminAPI) GetCluster

func (api *AdminAPI) GetCluster() (cv *proto.ClusterView, err error)

func (*AdminAPI) GetClusterInfo

func (api *AdminAPI) GetClusterInfo() (ci *proto.ClusterInfo, err error)

func (*AdminAPI) GetDataPartition

func (api *AdminAPI) GetDataPartition(volName string, partitionID uint64) (partition *proto.DataPartitionInfo, err error)

func (*AdminAPI) GetVolumeSimpleInfo

func (api *AdminAPI) GetVolumeSimpleInfo(volName string) (vv *proto.SimpleVolView, err error)

func (*AdminAPI) LoadDataPartition

func (api *AdminAPI) LoadDataPartition(volName string, partitionID uint64) (err error)

func (*AdminAPI) UpdateVolume

func (api *AdminAPI) UpdateVolume(volName string, capacity uint64, replicas int, followerRead bool, authKey string) (err error)

type ClientAPI

type ClientAPI struct {
	// contains filtered or unexported fields
}

func (*ClientAPI) GetDataPartitions

func (api *ClientAPI) GetDataPartitions(volName string) (view *proto.DataPartitionsView, err error)

func (*ClientAPI) GetMetaPartition

func (api *ClientAPI) GetMetaPartition(partitionID uint64) (partition *proto.MetaPartitionInfo, err error)

func (*ClientAPI) GetMetaPartitions

func (api *ClientAPI) GetMetaPartitions(volName string) (views []*proto.MetaPartitionView, err error)

func (*ClientAPI) GetVolume

func (api *ClientAPI) GetVolume(volName string, authKey string) (vv *proto.VolView, err error)

func (*ClientAPI) GetVolumeStat

func (api *ClientAPI) GetVolumeStat(volName string) (info *proto.VolStatInfo, err error)

func (*ClientAPI) GetVolumeWithAuthnode

func (api *ClientAPI) GetVolumeWithAuthnode(volName string, authKey string, token string, decoder Decoder) (vv *proto.VolView, err error)

func (*ClientAPI) GetVolumeWithoutAuthKey

func (api *ClientAPI) GetVolumeWithoutAuthKey(volName string) (vv *proto.VolView, err error)

type Decoder

type Decoder func([]byte) ([]byte, error)

func (Decoder) Decode

func (d Decoder) Decode(raw []byte) ([]byte, error)

type MasterClient

type MasterClient struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewMasterClient

func NewMasterClient(masters []string, useSSL bool) *MasterClient

NewMasterHelper returns a new MasterHelper instance.

func (*MasterClient) AddNode

func (c *MasterClient) AddNode(address string)

AddNode add the given address as the master address.

func (*MasterClient) AdminAPI

func (c *MasterClient) AdminAPI() *AdminAPI

func (*MasterClient) ClientAPI

func (c *MasterClient) ClientAPI() *ClientAPI

func (*MasterClient) Leader

func (c *MasterClient) Leader() (addr string)

Leader returns the current leader address.

func (*MasterClient) NodeAPI

func (c *MasterClient) NodeAPI() *NodeAPI

func (*MasterClient) Nodes

func (c *MasterClient) Nodes() (nodes []string)

Nodes returns all master addresses.

type NodeAPI

type NodeAPI struct {
	// contains filtered or unexported fields
}

func (*NodeAPI) AddDataNode

func (api *NodeAPI) AddDataNode(serverAddr string) (id uint64, err error)

func (*NodeAPI) AddMetaNode

func (api *NodeAPI) AddMetaNode(serverAddr string) (id uint64, err error)

func (*NodeAPI) GetDataNode

func (api *NodeAPI) GetDataNode(serverHost string) (node *proto.DataNodeInfo, err error)

func (*NodeAPI) GetMetaNode

func (api *NodeAPI) GetMetaNode(serverHost string) (node *proto.MetaNodeInfo, err error)

func (*NodeAPI) ResponseDataNodeTask

func (api *NodeAPI) ResponseDataNodeTask(task *proto.AdminTask) (err error)

func (*NodeAPI) ResponseMetaNodeTask

func (api *NodeAPI) ResponseMetaNodeTask(task *proto.AdminTask) (err error)

Jump to

Keyboard shortcuts

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