master

package
v2.0.0-rc.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: Apache-2.0 Imports: 13 Imported by: 9

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) 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) (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) ListVols

func (api *AdminAPI) ListVols(keywords string) (volsInfo []*proto.VolInfo, 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) GetToken

func (api *ClientAPI) GetToken(volName, tokenKey string) (token *proto.Token, 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) 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) 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)

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) 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
y or Y : Canonical URL