Documentation
¶
Index ¶
- Constants
- type Client
- type Conn
- type RPCClient
- func (c *RPCClient) AddColumns(dbId, tableId uint64, columns []*metapb.Column) ([]*metapb.Column, error)
- func (c *RPCClient) Close()
- func (c *RPCClient) CreateDatabase(dbName string) error
- func (c *RPCClient) CreateTable(dbName, tableName, properties string) error
- func (c *RPCClient) GetColumnByID(dbId, tableId uint64, columnId uint64) (*metapb.Column, error)
- func (c *RPCClient) GetColumnByName(dbId, tableId uint64, columnName string) (*metapb.Column, error)
- func (c *RPCClient) GetColumns(dbId, tableId uint64) ([]*metapb.Column, error)
- func (c *RPCClient) GetDB(dbName string) (*metapb.DataBase, error)
- func (c *RPCClient) GetNode(nodeId uint64) (*metapb.Node, error)
- func (c *RPCClient) GetNodeId(req *mspb.GetNodeIdRequest) (*mspb.GetNodeIdResponse, error)
- func (c *RPCClient) GetRoute(dbId, tableId uint64, key []byte) ([]*metapb.Route, error)
- func (c *RPCClient) GetTable(dbName, tableName string) (*metapb.Table, error)
- func (c *RPCClient) GetTableById(dbId uint64, tableId uint64) (*metapb.Table, error)
- func (c *RPCClient) NodeHeartbeat(req *mspb.NodeHeartbeatRequest) (*mspb.NodeHeartbeatResponse, error)
- func (c *RPCClient) NodeLogin(req *mspb.NodeLoginRequest) (*mspb.NodeLoginResponse, error)
- func (c *RPCClient) RangeHeartbeat(req *mspb.RangeHeartbeatRequest) (*mspb.RangeHeartbeatResponse, error)
- func (c *RPCClient) TruncateTable(dbId, tableId uint64) error
Constants ¶
View Source
const ( RequestMSTimeout = time.Second ConnectMSTimeout = time.Second * 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
// GetRoute gets a range and its leader Peer from MS by key.
// The range may expire after split. Caller is responsible for caching and
// taking care of range change.
// Also it may return nil if MS finds no range for the key temporarily,
// client should retry later.
GetRoute(dbId, tableId uint64, key []byte) ([]*metapb.Route, error)
GetNode(nodeId uint64) (*metapb.Node, error)
GetDB(dbName string) (*metapb.DataBase, error)
GetTable(dbName, tableName string) (*metapb.Table, error)
GetTableById(dbId, tableId uint64) (*metapb.Table, error)
GetColumns(dbId, tableId uint64) ([]*metapb.Column, error)
GetColumnByName(dbId, tableId uint64, columnName string) (*metapb.Column, error)
GetColumnByID(dbId, tableId uint64, columnId uint64) (*metapb.Column, error)
// columns输入参数只需要填写name和data type即可
// 返回master server处理后的columns列表(本次新增部分)
AddColumns(dbId, tableId uint64, columns []*metapb.Column) ([]*metapb.Column, error)
TruncateTable(dbId, tableId uint64) error
CreateDatabase(dbName string) error
CreateTable(dbName, tableName, properties string) error
NodeHeartbeat(*mspb.NodeHeartbeatRequest) (*mspb.NodeHeartbeatResponse, error)
RangeHeartbeat(*mspb.RangeHeartbeatRequest) (*mspb.RangeHeartbeatResponse, error)
NodeLogin(*mspb.NodeLoginRequest) (*mspb.NodeLoginResponse, error)
GetNodeId(*mspb.GetNodeIdRequest) (*mspb.GetNodeIdResponse, error)
// Close closes the client.
Close()
}
Client is a MS (master server) client. It should not be used after calling Close().
type Conn ¶
type Conn struct {
Cli mspb.MsServerClient
// contains filtered or unexported fields
}
type RPCClient ¶
type RPCClient struct {
// contains filtered or unexported fields
}
func (*RPCClient) AddColumns ¶
func (c *RPCClient) AddColumns(dbId, tableId uint64, columns []*metapb.Column) ([]*metapb.Column, error)
columns输入参数只需要填写name和data type即可 返回master server处理后的columns列表(本次新增部分)
func (*RPCClient) CreateDatabase ¶
func (*RPCClient) CreateTable ¶
func (*RPCClient) GetColumnByID ¶
func (*RPCClient) GetColumnByName ¶
func (*RPCClient) GetColumns ¶
func (*RPCClient) GetNodeId ¶
func (c *RPCClient) GetNodeId(req *mspb.GetNodeIdRequest) (*mspb.GetNodeIdResponse, error)
func (*RPCClient) GetTableById ¶
func (*RPCClient) NodeHeartbeat ¶
func (c *RPCClient) NodeHeartbeat(req *mspb.NodeHeartbeatRequest) (*mspb.NodeHeartbeatResponse, error)
func (*RPCClient) NodeLogin ¶
func (c *RPCClient) NodeLogin(req *mspb.NodeLoginRequest) (*mspb.NodeLoginResponse, error)
func (*RPCClient) RangeHeartbeat ¶
func (c *RPCClient) RangeHeartbeat(req *mspb.RangeHeartbeatRequest) (*mspb.RangeHeartbeatResponse, error)
func (*RPCClient) TruncateTable ¶
Click to show internal directories.
Click to hide internal directories.