Documentation
¶
Overview ¶
Package metapb is a generated protocol buffer package.
It is generated from these files:
metapb.proto
It has these top-level messages:
Cluster NodeLabel Node Peer Replica RangeEpoch Range Leader Route DataBase Column Primary TableEpoch Table
Index ¶
- Variables
- type Cluster
- func (*Cluster) Descriptor() ([]byte, []int)
- func (m *Cluster) GetId() uint64
- func (m *Cluster) GetMaxPeerCount() uint32
- func (m *Cluster) Marshal() (dAtA []byte, err error)
- func (m *Cluster) MarshalTo(dAtA []byte) (int, error)
- func (*Cluster) ProtoMessage()
- func (m *Cluster) Reset()
- func (m *Cluster) Size() (n int)
- func (m *Cluster) String() string
- func (m *Cluster) Unmarshal(dAtA []byte) error
- type Column
- func (*Column) Descriptor() ([]byte, []int)
- func (m *Column) GetDataType() DataType
- func (m *Column) GetDefaultValue() []byte
- func (m *Column) GetId() uint64
- func (m *Column) GetIndex() bool
- func (m *Column) GetName() string
- func (m *Column) GetNullable() bool
- func (m *Column) GetOrdinal() int32
- func (m *Column) GetPrecision() int32
- func (m *Column) GetPrimaryKey() uint64
- func (m *Column) GetProperties() string
- func (m *Column) GetScale() int32
- func (m *Column) GetUnsigned() bool
- func (m *Column) Marshal() (dAtA []byte, err error)
- func (m *Column) MarshalTo(dAtA []byte) (int, error)
- func (*Column) ProtoMessage()
- func (m *Column) Reset()
- func (m *Column) Size() (n int)
- func (m *Column) String() string
- func (m *Column) Unmarshal(dAtA []byte) error
- type DataBase
- func (*DataBase) Descriptor() ([]byte, []int)
- func (m *DataBase) GetCreateTime() int64
- func (m *DataBase) GetId() uint64
- func (m *DataBase) GetName() string
- func (m *DataBase) GetProperties() string
- func (m *DataBase) GetVersion() uint64
- func (m *DataBase) Marshal() (dAtA []byte, err error)
- func (m *DataBase) MarshalTo(dAtA []byte) (int, error)
- func (*DataBase) ProtoMessage()
- func (m *DataBase) Reset()
- func (m *DataBase) Size() (n int)
- func (m *DataBase) String() string
- func (m *DataBase) Unmarshal(dAtA []byte) error
- type DataType
- type Leader
- func (*Leader) Descriptor() ([]byte, []int)
- func (m *Leader) GetNodeAddr() string
- func (m *Leader) GetNodeId() uint64
- func (m *Leader) GetRangeId() uint64
- func (m *Leader) Marshal() (dAtA []byte, err error)
- func (m *Leader) MarshalTo(dAtA []byte) (int, error)
- func (*Leader) ProtoMessage()
- func (m *Leader) Reset()
- func (m *Leader) Size() (n int)
- func (m *Leader) String() string
- func (m *Leader) Unmarshal(dAtA []byte) error
- type Node
- func (*Node) Descriptor() ([]byte, []int)
- func (m *Node) GetHttpAddr() string
- func (m *Node) GetId() uint64
- func (m *Node) GetLabels() []*NodeLabel
- func (m *Node) GetRaftAddr() string
- func (m *Node) GetServerAddr() string
- func (m *Node) GetState() NodeState
- func (m *Node) GetVersion() string
- func (m *Node) Marshal() (dAtA []byte, err error)
- func (m *Node) MarshalTo(dAtA []byte) (int, error)
- func (*Node) ProtoMessage()
- func (m *Node) Reset()
- func (m *Node) Size() (n int)
- func (m *Node) String() string
- func (m *Node) Unmarshal(dAtA []byte) error
- type NodeLabel
- func (*NodeLabel) Descriptor() ([]byte, []int)
- func (m *NodeLabel) GetKey() string
- func (m *NodeLabel) GetValue() string
- func (m *NodeLabel) Marshal() (dAtA []byte, err error)
- func (m *NodeLabel) MarshalTo(dAtA []byte) (int, error)
- func (*NodeLabel) ProtoMessage()
- func (m *NodeLabel) Reset()
- func (m *NodeLabel) Size() (n int)
- func (m *NodeLabel) String() string
- func (m *NodeLabel) Unmarshal(dAtA []byte) error
- type NodeState
- type Peer
- func (*Peer) Descriptor() ([]byte, []int)
- func (m *Peer) GetId() uint64
- func (m *Peer) GetNodeId() uint64
- func (m *Peer) GetRole() ReplicaRole
- func (m *Peer) Marshal() (dAtA []byte, err error)
- func (m *Peer) MarshalTo(dAtA []byte) (int, error)
- func (*Peer) ProtoMessage()
- func (m *Peer) Reset()
- func (m *Peer) Size() (n int)
- func (m *Peer) String() string
- func (m *Peer) Unmarshal(dAtA []byte) error
- type Primary
- func (*Primary) Descriptor() ([]byte, []int)
- func (m *Primary) GetColumnName() string
- func (m *Primary) GetNext() *Primary
- func (m *Primary) Marshal() (dAtA []byte, err error)
- func (m *Primary) MarshalTo(dAtA []byte) (int, error)
- func (*Primary) ProtoMessage()
- func (m *Primary) Reset()
- func (m *Primary) Size() (n int)
- func (m *Primary) String() string
- func (m *Primary) Unmarshal(dAtA []byte) error
- type Range
- func (*Range) Descriptor() ([]byte, []int)
- func (m *Range) GetEndKey() []byte
- func (m *Range) GetId() uint64
- func (m *Range) GetPeers() []*Peer
- func (m *Range) GetPrimaryKeys() []*Column
- func (m *Range) GetRangeEpoch() *RangeEpoch
- func (m *Range) GetStartKey() []byte
- func (m *Range) GetTableId() uint64
- func (m *Range) Marshal() (dAtA []byte, err error)
- func (m *Range) MarshalTo(dAtA []byte) (int, error)
- func (*Range) ProtoMessage()
- func (m *Range) Reset()
- func (m *Range) Size() (n int)
- func (m *Range) String() string
- func (m *Range) Unmarshal(dAtA []byte) error
- type RangeEpoch
- func (*RangeEpoch) Descriptor() ([]byte, []int)
- func (m *RangeEpoch) GetConfVer() uint64
- func (m *RangeEpoch) GetVersion() uint64
- func (m *RangeEpoch) Marshal() (dAtA []byte, err error)
- func (m *RangeEpoch) MarshalTo(dAtA []byte) (int, error)
- func (*RangeEpoch) ProtoMessage()
- func (m *RangeEpoch) Reset()
- func (m *RangeEpoch) Size() (n int)
- func (m *RangeEpoch) String() string
- func (m *RangeEpoch) Unmarshal(dAtA []byte) error
- type RangeState
- type Replica
- func (*Replica) Descriptor() ([]byte, []int)
- func (m *Replica) GetEndKey() []byte
- func (m *Replica) GetPeer() *Peer
- func (m *Replica) GetRangeId() uint64
- func (m *Replica) GetStartKey() []byte
- func (m *Replica) Marshal() (dAtA []byte, err error)
- func (m *Replica) MarshalTo(dAtA []byte) (int, error)
- func (*Replica) ProtoMessage()
- func (m *Replica) Reset()
- func (m *Replica) Size() (n int)
- func (m *Replica) String() string
- func (m *Replica) Unmarshal(dAtA []byte) error
- type ReplicaRole
- type Route
- func (*Route) Descriptor() ([]byte, []int)
- func (m *Route) GetLeader() *Peer
- func (m *Route) GetRange() *Range
- func (m *Route) Marshal() (dAtA []byte, err error)
- func (m *Route) MarshalTo(dAtA []byte) (int, error)
- func (*Route) ProtoMessage()
- func (m *Route) Reset()
- func (m *Route) Size() (n int)
- func (m *Route) String() string
- func (m *Route) Unmarshal(dAtA []byte) error
- type Table
- func (*Table) Descriptor() ([]byte, []int)
- func (m *Table) GetColumns() []*Column
- func (m *Table) GetCreateTime() int64
- func (m *Table) GetDbId() uint64
- func (m *Table) GetDbName() string
- func (m *Table) GetEpoch() *TableEpoch
- func (m *Table) GetExpand() []byte
- func (m *Table) GetId() uint64
- func (m *Table) GetName() string
- func (m *Table) GetPkDupCheck() bool
- func (m *Table) GetProperties() string
- func (m *Table) GetRegxs() []*Column
- func (m *Table) GetStatus() TableStatus
- func (m *Table) Marshal() (dAtA []byte, err error)
- func (m *Table) MarshalTo(dAtA []byte) (int, error)
- func (*Table) ProtoMessage()
- func (m *Table) Reset()
- func (m *Table) Size() (n int)
- func (m *Table) String() string
- func (m *Table) Unmarshal(dAtA []byte) error
- type TableEpoch
- func (*TableEpoch) Descriptor() ([]byte, []int)
- func (m *TableEpoch) GetConfVer() uint64
- func (m *TableEpoch) GetVersion() uint64
- func (m *TableEpoch) Marshal() (dAtA []byte, err error)
- func (m *TableEpoch) MarshalTo(dAtA []byte) (int, error)
- func (*TableEpoch) ProtoMessage()
- func (m *TableEpoch) Reset()
- func (m *TableEpoch) Size() (n int)
- func (m *TableEpoch) String() string
- func (m *TableEpoch) Unmarshal(dAtA []byte) error
- type TableStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLengthMetapb = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowMetapb = fmt.Errorf("proto: integer overflow") )
View Source
var DataType_name = map[int32]string{
0: "Invalid",
1: "Tinyint",
2: "Smallint",
3: "Int",
4: "BigInt",
5: "Float",
6: "Double",
7: "Varchar",
8: "Binary",
9: "Date",
10: "TimeStamp",
}
View Source
var DataType_value = map[string]int32{
"Invalid": 0,
"Tinyint": 1,
"Smallint": 2,
"Int": 3,
"BigInt": 4,
"Float": 5,
"Double": 6,
"Varchar": 7,
"Binary": 8,
"Date": 9,
"TimeStamp": 10,
}
View Source
var NodeState_name = map[int32]string{
0: "N_Invalid",
1: "N_Login",
2: "N_Logout",
3: "N_Offline",
4: "N_Tombstone",
5: "N_Upgrade",
6: "N_Initial",
}
View Source
var NodeState_value = map[string]int32{
"N_Invalid": 0,
"N_Login": 1,
"N_Logout": 2,
"N_Offline": 3,
"N_Tombstone": 4,
"N_Upgrade": 5,
"N_Initial": 6,
}
View Source
var RangeState_name = map[int32]string{
0: "R_Invalid",
1: "R_Init",
2: "R_Normal",
3: "R_Split",
4: "R_Merge",
5: "R_Remove",
6: "R_LoadSnap",
7: "R_Abnormal",
8: "R_Offline",
}
View Source
var RangeState_value = map[string]int32{
"R_Invalid": 0,
"R_Init": 1,
"R_Normal": 2,
"R_Split": 3,
"R_Merge": 4,
"R_Remove": 5,
"R_LoadSnap": 6,
"R_Abnormal": 7,
"R_Offline": 8,
}
View Source
var ReplicaRole_name = map[int32]string{
0: "Role_Invalid",
1: "Role_Sync_Replica",
2: "Role_Async_Replica",
}
View Source
var ReplicaRole_value = map[string]int32{
"Role_Invalid": 0,
"Role_Sync_Replica": 1,
"Role_Async_Replica": 2,
}
View Source
var TableStatus_name = map[int32]string{
0: "TableInvalid",
1: "TableInit",
2: "TablePrepare",
3: "TableRunning",
4: "TableDelete",
5: "TableDeleting",
}
View Source
var TableStatus_value = map[string]int32{
"TableInvalid": 0,
"TableInit": 1,
"TablePrepare": 2,
"TableRunning": 3,
"TableDelete": 4,
"TableDeleting": 5,
}
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
// max peer count for a Range.
// master server will do the auto-balance if Range peer count mismatches.
MaxPeerCount uint32 `protobuf:"varint,2,opt,name=max_peer_count,json=maxPeerCount,proto3" json:"max_peer_count,omitempty"`
}
func (*Cluster) Descriptor ¶
func (*Cluster) GetMaxPeerCount ¶
func (*Cluster) ProtoMessage ¶
func (*Cluster) ProtoMessage()
type Column ¶
type Column struct {
// max size 128 bytes
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// 列名映射的ID,客户端不可见
Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
DataType DataType `protobuf:"varint,3,opt,name=data_type,json=dataType,proto3,enum=metapb.DataType" json:"data_type,omitempty"`
// 针对int类型,是否是无符号类型
Unsigned bool `protobuf:"varint,4,opt,name=unsigned,proto3" json:"unsigned,omitempty"`
// 针对float和varchar类型
Scale int32 `protobuf:"varint,5,opt,name=scale,proto3" json:"scale,omitempty"`
// 针对float类型
Precision int32 `protobuf:"varint,6,opt,name=precision,proto3" json:"precision,omitempty"`
// 是否可以为空
Nullable bool `protobuf:"varint,7,opt,name=nullable,proto3" json:"nullable,omitempty"`
// 是否主键
PrimaryKey uint64 `protobuf:"varint,8,opt,name=primary_key,json=primaryKey,proto3" json:"primary_key,omitempty"`
// 列的顺序
Ordinal int32 `protobuf:"varint,9,opt,name=ordinal,proto3" json:"ordinal,omitempty"`
// 索引 Binary不支持索引,其他类型列默认均是索引列
Index bool `protobuf:"varint,10,opt,name=index,proto3" json:"index,omitempty"`
DefaultValue []byte `protobuf:"bytes,11,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"`
Properties string `protobuf:"bytes,12,opt,name=properties,proto3" json:"properties,omitempty"`
}
func (*Column) Descriptor ¶
func (*Column) GetDataType ¶
func (*Column) GetDefaultValue ¶
func (*Column) GetNullable ¶
func (*Column) GetOrdinal ¶
func (*Column) GetPrecision ¶
func (*Column) GetPrimaryKey ¶
func (*Column) GetProperties ¶
func (*Column) GetUnsigned ¶
func (*Column) ProtoMessage ¶
func (*Column) ProtoMessage()
type DataBase ¶
type DataBase struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
Properties string `protobuf:"bytes,3,opt,name=properties,proto3" json:"properties,omitempty"`
Version uint64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"`
CreateTime int64 `protobuf:"varint,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
}
func (*DataBase) Descriptor ¶
func (*DataBase) GetCreateTime ¶
func (*DataBase) GetProperties ¶
func (*DataBase) GetVersion ¶
func (*DataBase) ProtoMessage ¶
func (*DataBase) ProtoMessage()
type DataType ¶
type DataType int32
const ( DataType_Invalid DataType = 0 // 8 bit interger DataType_Tinyint DataType = 1 // 16 bit interger DataType_Smallint DataType = 2 // 32 bit interger DataType_Int DataType = 3 // 64 bit interger DataType_BigInt DataType = 4 // 32 bit float DataType_Float DataType = 5 // 64 bit float DataType_Double DataType = 6 // string UTF-8 max size 64 KB DataType_Varchar DataType = 7 // Blob max size 64 KB DataType_Binary DataType = 8 // DataTime 从1970年1月1日以来的天数 DataType_Date DataType = 9 // DataTime 从1970年1月1日以来的秒数,精确到纳秒 DataType_TimeStamp DataType = 10 )
func (DataType) EnumDescriptor ¶
type Leader ¶
type Leader struct {
RangeId uint64 `protobuf:"varint,1,opt,name=range_id,json=rangeId,proto3" json:"range_id,omitempty"`
NodeId uint64 `protobuf:"varint,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"`
NodeAddr string `protobuf:"bytes,3,opt,name=node_addr,json=nodeAddr,proto3" json:"node_addr,omitempty"`
}
func (*Leader) Descriptor ¶
func (*Leader) GetNodeAddr ¶
func (*Leader) GetRangeId ¶
func (*Leader) ProtoMessage ¶
func (*Leader) ProtoMessage()
type Node ¶
type Node struct {
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
// rpc 服务地址
ServerAddr string `protobuf:"bytes,2,opt,name=server_addr,json=serverAddr,proto3" json:"server_addr,omitempty"`
// raft 服务地址
RaftAddr string `protobuf:"bytes,3,opt,name=raft_addr,json=raftAddr,proto3" json:"raft_addr,omitempty"`
// http 管理地址
HttpAddr string `protobuf:"bytes,4,opt,name=http_addr,json=httpAddr,proto3" json:"http_addr,omitempty"`
State NodeState `protobuf:"varint,5,opt,name=state,proto3,enum=metapb.NodeState" json:"state,omitempty"`
Version string `protobuf:"bytes,6,opt,name=version,proto3" json:"version,omitempty"`
Labels []*NodeLabel `protobuf:"bytes,7,rep,name=labels" json:"labels,omitempty"`
}
func (*Node) Descriptor ¶
func (*Node) GetHttpAddr ¶
func (*Node) GetRaftAddr ¶
func (*Node) GetServerAddr ¶
func (*Node) GetVersion ¶
func (*Node) ProtoMessage ¶
func (*Node) ProtoMessage()
type NodeLabel ¶
type NodeLabel struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}
Case insensitive key/value for replica constraints.
func (*NodeLabel) Descriptor ¶
func (*NodeLabel) ProtoMessage ¶
func (*NodeLabel) ProtoMessage()
type NodeState ¶
type NodeState int32
1. 无论什么条件下,除了已经Logout的节点,新旧ds加入集群后,ms都应该将其初始化为Initial状态, 由ds自检完成后,通过NodeLogin上报正式启动数据读写服务 2. Logout的节点,需要手动Initial
const ( NodeState_N_Invalid NodeState = 0 // 工作状态,可以提供服务 NodeState_N_Login NodeState = 1 // 此状态下节点的range已经全部迁移,必须手动login NodeState_N_Logout NodeState = 2 // 此状态下节点不分配新的range,不迁移range NodeState_N_Offline NodeState = 3 // 此状态下节点不分配新的range,开始逐步迁移range NodeState_N_Tombstone NodeState = 4 // 节点升级 NodeState_N_Upgrade NodeState = 5 // 初始状态 NodeState_N_Initial NodeState = 6 )
func (NodeState) EnumDescriptor ¶
type Peer ¶
type Peer struct {
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
NodeId uint64 `protobuf:"varint,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"`
Role ReplicaRole `protobuf:"varint,3,opt,name=role,proto3,enum=metapb.ReplicaRole" json:"role,omitempty"`
}
func (*Peer) Descriptor ¶
func (*Peer) GetRole ¶
func (m *Peer) GetRole() ReplicaRole
func (*Peer) ProtoMessage ¶
func (*Peer) ProtoMessage()
type Primary ¶
type Primary struct {
ColumnName string `protobuf:"bytes,1,opt,name=column_name,json=columnName,proto3" json:"column_name,omitempty"`
Next *Primary `protobuf:"bytes,2,opt,name=next" json:"next,omitempty"`
}
func (*Primary) Descriptor ¶
func (*Primary) GetColumnName ¶
func (*Primary) ProtoMessage ¶
func (*Primary) ProtoMessage()
type Range ¶
type Range struct {
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
// Range key range [start_key, end_key).
// key的组成 prefix + table_id + real key
StartKey []byte `protobuf:"bytes,2,opt,name=start_key,json=startKey,proto3" json:"start_key,omitempty"`
EndKey []byte `protobuf:"bytes,3,opt,name=end_key,json=endKey,proto3" json:"end_key,omitempty"`
RangeEpoch *RangeEpoch `protobuf:"bytes,4,opt,name=range_epoch,json=rangeEpoch" json:"range_epoch,omitempty"`
Peers []*Peer `protobuf:"bytes,5,rep,name=peers" json:"peers,omitempty"`
TableId uint64 `protobuf:"varint,6,opt,name=table_id,json=tableId,proto3" json:"table_id,omitempty"`
PrimaryKeys []*Column `protobuf:"bytes,7,rep,name=primary_keys,json=primaryKeys" json:"primary_keys,omitempty"`
}
func (*Range) Descriptor ¶
func (*Range) GetPrimaryKeys ¶
func (*Range) GetRangeEpoch ¶
func (m *Range) GetRangeEpoch() *RangeEpoch
func (*Range) GetStartKey ¶
func (*Range) GetTableId ¶
func (*Range) ProtoMessage ¶
func (*Range) ProtoMessage()
type RangeEpoch ¶
type RangeEpoch struct {
// Conf change version, auto increment when add or remove peer
ConfVer uint64 `protobuf:"varint,1,opt,name=conf_ver,json=confVer,proto3" json:"conf_ver,omitempty"`
// Range version, auto increment when split or merge
Version uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
}
func (*RangeEpoch) Descriptor ¶
func (*RangeEpoch) Descriptor() ([]byte, []int)
func (*RangeEpoch) GetConfVer ¶
func (m *RangeEpoch) GetConfVer() uint64
func (*RangeEpoch) GetVersion ¶
func (m *RangeEpoch) GetVersion() uint64
func (*RangeEpoch) Marshal ¶
func (m *RangeEpoch) Marshal() (dAtA []byte, err error)
func (*RangeEpoch) ProtoMessage ¶
func (*RangeEpoch) ProtoMessage()
func (*RangeEpoch) Reset ¶
func (m *RangeEpoch) Reset()
func (*RangeEpoch) Size ¶
func (m *RangeEpoch) Size() (n int)
func (*RangeEpoch) String ¶
func (m *RangeEpoch) String() string
func (*RangeEpoch) Unmarshal ¶
func (m *RangeEpoch) Unmarshal(dAtA []byte) error
type RangeState ¶
type RangeState int32
const ( RangeState_R_Invalid RangeState = 0 RangeState_R_Init RangeState = 1 RangeState_R_Normal RangeState = 2 RangeState_R_Split RangeState = 3 RangeState_R_Merge RangeState = 4 RangeState_R_Remove RangeState = 5 RangeState_R_LoadSnap RangeState = 6 RangeState_R_Abnormal RangeState = 7 RangeState_R_Offline RangeState = 8 )
func (RangeState) EnumDescriptor ¶
func (RangeState) EnumDescriptor() ([]byte, []int)
func (RangeState) String ¶
func (x RangeState) String() string
type Replica ¶
type Replica struct {
RangeId uint64 `protobuf:"varint,1,opt,name=range_id,json=rangeId,proto3" json:"range_id,omitempty"`
Peer *Peer `protobuf:"bytes,2,opt,name=peer" json:"peer,omitempty"`
StartKey []byte `protobuf:"bytes,3,opt,name=start_key,json=startKey,proto3" json:"start_key,omitempty"`
EndKey []byte `protobuf:"bytes,4,opt,name=end_key,json=endKey,proto3" json:"end_key,omitempty"`
}
func (*Replica) Descriptor ¶
func (*Replica) GetRangeId ¶
func (*Replica) GetStartKey ¶
func (*Replica) ProtoMessage ¶
func (*Replica) ProtoMessage()
type ReplicaRole ¶
type ReplicaRole int32
const ( ReplicaRole_Role_Invalid ReplicaRole = 0 // 同步副本 ReplicaRole_Role_Sync_Replica ReplicaRole = 1 // 异步副本,不参与raft选举 ReplicaRole_Role_Async_Replica ReplicaRole = 2 )
func (ReplicaRole) EnumDescriptor ¶
func (ReplicaRole) EnumDescriptor() ([]byte, []int)
func (ReplicaRole) String ¶
func (x ReplicaRole) String() string
type Route ¶
type Route struct {
Range *Range `protobuf:"bytes,1,opt,name=range" json:"range,omitempty"`
Leader *Peer `protobuf:"bytes,2,opt,name=leader" json:"leader,omitempty"`
}
func (*Route) Descriptor ¶
func (*Route) ProtoMessage ¶
func (*Route) ProtoMessage()
type Table ¶
type Table struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
DbName string `protobuf:"bytes,2,opt,name=db_name,json=dbName,proto3" json:"db_name,omitempty"`
DbId uint64 `protobuf:"varint,3,opt,name=db_id,json=dbId,proto3" json:"db_id,omitempty"`
Id uint64 `protobuf:"varint,4,opt,name=id,proto3" json:"id,omitempty"`
// 必须有主键
// repeated string primary_key = 4;
Properties string `protobuf:"bytes,5,opt,name=properties,proto3" json:"properties,omitempty"`
Columns []*Column `protobuf:"bytes,6,rep,name=columns" json:"columns,omitempty"`
Epoch *TableEpoch `protobuf:"bytes,7,opt,name=epoch" json:"epoch,omitempty"`
Regxs []*Column `protobuf:"bytes,8,rep,name=regxs" json:"regxs,omitempty"`
CreateTime int64 `protobuf:"varint,9,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
// 默认不检查主键重复
PkDupCheck bool `protobuf:"varint,10,opt,name=pk_dup_check,json=pkDupCheck,proto3" json:"pk_dup_check,omitempty"`
// table status
Status TableStatus `protobuf:"varint,11,opt,name=status,proto3,enum=metapb.TableStatus" json:"status,omitempty"`
// table expand area
// now when status is TableDelete, expand is the delete flag time
Expand []byte `protobuf:"bytes,12,opt,name=expand,proto3" json:"expand,omitempty"`
}
func (*Table) Descriptor ¶
func (*Table) GetColumns ¶
func (*Table) GetCreateTime ¶
func (*Table) GetEpoch ¶
func (m *Table) GetEpoch() *TableEpoch
func (*Table) GetPkDupCheck ¶
func (*Table) GetProperties ¶
func (*Table) GetStatus ¶
func (m *Table) GetStatus() TableStatus
func (*Table) ProtoMessage ¶
func (*Table) ProtoMessage()
type TableEpoch ¶
type TableEpoch struct {
// Conf change version, auto increment when add or remove column
ConfVer uint64 `protobuf:"varint,1,opt,name=conf_ver,json=confVer,proto3" json:"conf_ver,omitempty"`
// Route version, auto increment when split or merge
Version uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
}
func (*TableEpoch) Descriptor ¶
func (*TableEpoch) Descriptor() ([]byte, []int)
func (*TableEpoch) GetConfVer ¶
func (m *TableEpoch) GetConfVer() uint64
func (*TableEpoch) GetVersion ¶
func (m *TableEpoch) GetVersion() uint64
func (*TableEpoch) Marshal ¶
func (m *TableEpoch) Marshal() (dAtA []byte, err error)
func (*TableEpoch) ProtoMessage ¶
func (*TableEpoch) ProtoMessage()
func (*TableEpoch) Reset ¶
func (m *TableEpoch) Reset()
func (*TableEpoch) Size ¶
func (m *TableEpoch) Size() (n int)
func (*TableEpoch) String ¶
func (m *TableEpoch) String() string
func (*TableEpoch) Unmarshal ¶
func (m *TableEpoch) Unmarshal(dAtA []byte) error
type TableStatus ¶
type TableStatus int32
const ( TableStatus_TableInvalid TableStatus = 0 // 初始状态,table刚刚创建,分片还不能提供服务 TableStatus_TableInit TableStatus = 1 // 准备状态,等待table的初始分片补足三个副本 TableStatus_TablePrepare TableStatus = 2 // 正常状态,可以提供完全的服务 TableStatus_TableRunning TableStatus = 3 // 标记删除,元数据都保留,允许分片参与调度,但不能分裂 TableStatus_TableDelete TableStatus = 4 // 正在删除 TableStatus_TableDeleting TableStatus = 5 )
func (TableStatus) EnumDescriptor ¶
func (TableStatus) EnumDescriptor() ([]byte, []int)
func (TableStatus) String ¶
func (x TableStatus) String() string
Click to show internal directories.
Click to hide internal directories.