master

package
Version: v2.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 14, 2021 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) AddMetaReplica

func (api *AdminAPI) AddMetaReplica(metaPartitionID uint64, nodeAddr string) (err error)

func (*AdminAPI) CreateDataPartition

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

func (*AdminAPI) CreateDefaultVolume

func (api *AdminAPI) CreateDefaultVolume(volName, owner string) (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, zoneName string) (err error)

func (*AdminAPI) DecommissionDataPartition

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

func (*AdminAPI) DecommissionMetaPartition

func (api *AdminAPI) DecommissionMetaPartition(metaPartitionID uint64, nodeAddr string) (err error)

func (*AdminAPI) DeleteDataReplica

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

func (*AdminAPI) DeleteMetaReplica

func (api *AdminAPI) DeleteMetaReplica(metaPartitionID uint64, nodeAddr string) (err error)

func (*AdminAPI) DeleteVolume

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

func (*AdminAPI) DiagnoseDataPartition

func (api *AdminAPI) DiagnoseDataPartition() (diagnosis *proto.DataPartitionDiagnosis, err error)

func (*AdminAPI) DiagnoseMetaPartition

func (api *AdminAPI) DiagnoseMetaPartition() (diagnosis *proto.MetaPartitionDiagnosis, 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) GetClusterStat

func (api *AdminAPI) GetClusterStat() (cs *proto.ClusterStatInfo, err error)

func (*AdminAPI) GetDataPartition

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

func (*AdminAPI) GetDeleteParas

func (api *AdminAPI) GetDeleteParas() (delParas map[string]string, err error)

func (*AdminAPI) GetVolumeSimpleInfo

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

func (*AdminAPI) IsFreezeCluster

func (api *AdminAPI) IsFreezeCluster(isFreeze bool) (err error)

func (*AdminAPI) ListVols

func (api *AdminAPI) ListVols(keywords string) (volsInfo []*proto.VolInfo, err error)

func (*AdminAPI) ListZones

func (api *AdminAPI) ListZones() (zoneViews []*proto.ZoneView, err error)

func (*AdminAPI) LoadDataPartition

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

func (*AdminAPI) SetDeleteParas

func (api *AdminAPI) SetDeleteParas(batchCount, markDeleteRate, deleteWorkerSleepMs, autoRepairRate string) (err error)

func (*AdminAPI) SetMetaNodeThreshold

func (api *AdminAPI) SetMetaNodeThreshold(threshold float64) (err error)

func (*AdminAPI) Topo

func (api *AdminAPI) Topo() (topo *proto.TopologyView, err error)

func (*AdminAPI) UpdateVolume

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

func (*AdminAPI) VolExpand

func (api *AdminAPI) VolExpand(volName string, capacity uint64, authKey string) (err error)

func (*AdminAPI) VolShrink

func (api *AdminAPI) VolShrink(volName string, capacity uint64, 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 MasterClient instance.

func NewMasterClientFromString

func NewMasterClientFromString(masterAddr string, useSSL bool) *MasterClient

NewMasterClientFromString parse raw master address configuration string and returns a new MasterClient instance. Notes that a valid format raw string must match: "{HOST}:{PORT},{HOST}:{PORT}"

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.

func (*MasterClient) SetTimeout

func (c *MasterClient) SetTimeout(timeout uint16)

Change the request timeout

func (*MasterClient) UserAPI

func (c *MasterClient) UserAPI() *UserAPI

type NodeAPI

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

func (*NodeAPI) AddDataNode

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

func (*NodeAPI) AddMetaNode

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

func (*NodeAPI) DataNodeDecommission

func (api *NodeAPI) DataNodeDecommission(nodeAddr string) (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) MetaNodeDecommission

func (api *NodeAPI) MetaNodeDecommission(nodeAddr string) (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)

type UserAPI

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

func (*UserAPI) CreateUser

func (api *UserAPI) CreateUser(param *proto.UserCreateParam) (userInfo *proto.UserInfo, err error)

func (*UserAPI) DeleteUser

func (api *UserAPI) DeleteUser(userID string) (err error)

func (*UserAPI) DeleteVolPolicy

func (api *UserAPI) DeleteVolPolicy(vol string) (err error)

func (*UserAPI) GetAKInfo

func (api *UserAPI) GetAKInfo(accesskey string) (userInfo *proto.UserInfo, err error)

func (*UserAPI) GetUserInfo

func (api *UserAPI) GetUserInfo(userID string) (userInfo *proto.UserInfo, err error)

func (*UserAPI) ListUsers

func (api *UserAPI) ListUsers(keywords string) (users []*proto.UserInfo, err error)

func (*UserAPI) ListUsersOfVol

func (api *UserAPI) ListUsersOfVol(vol string) (users []string, err error)

func (*UserAPI) RemovePolicy

func (api *UserAPI) RemovePolicy(param *proto.UserPermRemoveParam) (userInfo *proto.UserInfo, err error)

func (*UserAPI) TransferVol

func (api *UserAPI) TransferVol(param *proto.UserTransferVolParam) (userInfo *proto.UserInfo, err error)

func (*UserAPI) UpdatePolicy

func (api *UserAPI) UpdatePolicy(param *proto.UserPermUpdateParam) (userInfo *proto.UserInfo, err error)

func (*UserAPI) UpdateUser

func (api *UserAPI) UpdateUser(param *proto.UserUpdateParam) (userInfo *proto.UserInfo, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL