metapb

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

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

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) Descriptor() ([]byte, []int)

func (*Cluster) GetId

func (m *Cluster) GetId() uint64

func (*Cluster) GetMaxPeerCount

func (m *Cluster) GetMaxPeerCount() uint32

func (*Cluster) Marshal

func (m *Cluster) Marshal() (dAtA []byte, err error)

func (*Cluster) MarshalTo

func (m *Cluster) MarshalTo(dAtA []byte) (int, error)

func (*Cluster) ProtoMessage

func (*Cluster) ProtoMessage()

func (*Cluster) Reset

func (m *Cluster) Reset()

func (*Cluster) Size

func (m *Cluster) Size() (n int)

func (*Cluster) String

func (m *Cluster) String() string

func (*Cluster) Unmarshal

func (m *Cluster) Unmarshal(dAtA []byte) error

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) Descriptor() ([]byte, []int)

func (*Column) GetDataType

func (m *Column) GetDataType() DataType

func (*Column) GetDefaultValue

func (m *Column) GetDefaultValue() []byte

func (*Column) GetId

func (m *Column) GetId() uint64

func (*Column) GetIndex

func (m *Column) GetIndex() bool

func (*Column) GetName

func (m *Column) GetName() string

func (*Column) GetNullable

func (m *Column) GetNullable() bool

func (*Column) GetOrdinal

func (m *Column) GetOrdinal() int32

func (*Column) GetPrecision

func (m *Column) GetPrecision() int32

func (*Column) GetPrimaryKey

func (m *Column) GetPrimaryKey() uint64

func (*Column) GetProperties

func (m *Column) GetProperties() string

func (*Column) GetScale

func (m *Column) GetScale() int32

func (*Column) GetUnsigned

func (m *Column) GetUnsigned() bool

func (*Column) Marshal

func (m *Column) Marshal() (dAtA []byte, err error)

func (*Column) MarshalTo

func (m *Column) MarshalTo(dAtA []byte) (int, error)

func (*Column) ProtoMessage

func (*Column) ProtoMessage()

func (*Column) Reset

func (m *Column) Reset()

func (*Column) Size

func (m *Column) Size() (n int)

func (*Column) String

func (m *Column) String() string

func (*Column) Unmarshal

func (m *Column) Unmarshal(dAtA []byte) error

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) Descriptor() ([]byte, []int)

func (*DataBase) GetCreateTime

func (m *DataBase) GetCreateTime() int64

func (*DataBase) GetId

func (m *DataBase) GetId() uint64

func (*DataBase) GetName

func (m *DataBase) GetName() string

func (*DataBase) GetProperties

func (m *DataBase) GetProperties() string

func (*DataBase) GetVersion

func (m *DataBase) GetVersion() uint64

func (*DataBase) Marshal

func (m *DataBase) Marshal() (dAtA []byte, err error)

func (*DataBase) MarshalTo

func (m *DataBase) MarshalTo(dAtA []byte) (int, error)

func (*DataBase) ProtoMessage

func (*DataBase) ProtoMessage()

func (*DataBase) Reset

func (m *DataBase) Reset()

func (*DataBase) Size

func (m *DataBase) Size() (n int)

func (*DataBase) String

func (m *DataBase) String() string

func (*DataBase) Unmarshal

func (m *DataBase) Unmarshal(dAtA []byte) error

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

func (DataType) EnumDescriptor() ([]byte, []int)

func (DataType) String

func (x DataType) String() string

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) Descriptor() ([]byte, []int)

func (*Leader) GetNodeAddr

func (m *Leader) GetNodeAddr() string

func (*Leader) GetNodeId

func (m *Leader) GetNodeId() uint64

func (*Leader) GetRangeId

func (m *Leader) GetRangeId() uint64

func (*Leader) Marshal

func (m *Leader) Marshal() (dAtA []byte, err error)

func (*Leader) MarshalTo

func (m *Leader) MarshalTo(dAtA []byte) (int, error)

func (*Leader) ProtoMessage

func (*Leader) ProtoMessage()

func (*Leader) Reset

func (m *Leader) Reset()

func (*Leader) Size

func (m *Leader) Size() (n int)

func (*Leader) String

func (m *Leader) String() string

func (*Leader) Unmarshal

func (m *Leader) Unmarshal(dAtA []byte) error

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) Descriptor() ([]byte, []int)

func (*Node) GetHttpAddr

func (m *Node) GetHttpAddr() string

func (*Node) GetId

func (m *Node) GetId() uint64

func (*Node) GetLabels

func (m *Node) GetLabels() []*NodeLabel

func (*Node) GetRaftAddr

func (m *Node) GetRaftAddr() string

func (*Node) GetServerAddr

func (m *Node) GetServerAddr() string

func (*Node) GetState

func (m *Node) GetState() NodeState

func (*Node) GetVersion

func (m *Node) GetVersion() string

func (*Node) Marshal

func (m *Node) Marshal() (dAtA []byte, err error)

func (*Node) MarshalTo

func (m *Node) MarshalTo(dAtA []byte) (int, error)

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) Reset

func (m *Node) Reset()

func (*Node) Size

func (m *Node) Size() (n int)

func (*Node) String

func (m *Node) String() string

func (*Node) Unmarshal

func (m *Node) Unmarshal(dAtA []byte) error

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) Descriptor() ([]byte, []int)

func (*NodeLabel) GetKey

func (m *NodeLabel) GetKey() string

func (*NodeLabel) GetValue

func (m *NodeLabel) GetValue() string

func (*NodeLabel) Marshal

func (m *NodeLabel) Marshal() (dAtA []byte, err error)

func (*NodeLabel) MarshalTo

func (m *NodeLabel) MarshalTo(dAtA []byte) (int, error)

func (*NodeLabel) ProtoMessage

func (*NodeLabel) ProtoMessage()

func (*NodeLabel) Reset

func (m *NodeLabel) Reset()

func (*NodeLabel) Size

func (m *NodeLabel) Size() (n int)

func (*NodeLabel) String

func (m *NodeLabel) String() string

func (*NodeLabel) Unmarshal

func (m *NodeLabel) Unmarshal(dAtA []byte) error

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

func (NodeState) EnumDescriptor() ([]byte, []int)

func (NodeState) String

func (x NodeState) String() string

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) Descriptor() ([]byte, []int)

func (*Peer) GetId

func (m *Peer) GetId() uint64

func (*Peer) GetNodeId

func (m *Peer) GetNodeId() uint64

func (*Peer) GetRole

func (m *Peer) GetRole() ReplicaRole

func (*Peer) Marshal

func (m *Peer) Marshal() (dAtA []byte, err error)

func (*Peer) MarshalTo

func (m *Peer) MarshalTo(dAtA []byte) (int, error)

func (*Peer) ProtoMessage

func (*Peer) ProtoMessage()

func (*Peer) Reset

func (m *Peer) Reset()

func (*Peer) Size

func (m *Peer) Size() (n int)

func (*Peer) String

func (m *Peer) String() string

func (*Peer) Unmarshal

func (m *Peer) Unmarshal(dAtA []byte) error

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) Descriptor() ([]byte, []int)

func (*Primary) GetColumnName

func (m *Primary) GetColumnName() string

func (*Primary) GetNext

func (m *Primary) GetNext() *Primary

func (*Primary) Marshal

func (m *Primary) Marshal() (dAtA []byte, err error)

func (*Primary) MarshalTo

func (m *Primary) MarshalTo(dAtA []byte) (int, error)

func (*Primary) ProtoMessage

func (*Primary) ProtoMessage()

func (*Primary) Reset

func (m *Primary) Reset()

func (*Primary) Size

func (m *Primary) Size() (n int)

func (*Primary) String

func (m *Primary) String() string

func (*Primary) Unmarshal

func (m *Primary) Unmarshal(dAtA []byte) error

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) Descriptor() ([]byte, []int)

func (*Range) GetEndKey

func (m *Range) GetEndKey() []byte

func (*Range) GetId

func (m *Range) GetId() uint64

func (*Range) GetPeers

func (m *Range) GetPeers() []*Peer

func (*Range) GetPrimaryKeys

func (m *Range) GetPrimaryKeys() []*Column

func (*Range) GetRangeEpoch

func (m *Range) GetRangeEpoch() *RangeEpoch

func (*Range) GetStartKey

func (m *Range) GetStartKey() []byte

func (*Range) GetTableId

func (m *Range) GetTableId() uint64

func (*Range) Marshal

func (m *Range) Marshal() (dAtA []byte, err error)

func (*Range) MarshalTo

func (m *Range) MarshalTo(dAtA []byte) (int, error)

func (*Range) ProtoMessage

func (*Range) ProtoMessage()

func (*Range) Reset

func (m *Range) Reset()

func (*Range) Size

func (m *Range) Size() (n int)

func (*Range) String

func (m *Range) String() string

func (*Range) Unmarshal

func (m *Range) Unmarshal(dAtA []byte) error

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) MarshalTo

func (m *RangeEpoch) MarshalTo(dAtA []byte) (int, 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) Descriptor() ([]byte, []int)

func (*Replica) GetEndKey

func (m *Replica) GetEndKey() []byte

func (*Replica) GetPeer

func (m *Replica) GetPeer() *Peer

func (*Replica) GetRangeId

func (m *Replica) GetRangeId() uint64

func (*Replica) GetStartKey

func (m *Replica) GetStartKey() []byte

func (*Replica) Marshal

func (m *Replica) Marshal() (dAtA []byte, err error)

func (*Replica) MarshalTo

func (m *Replica) MarshalTo(dAtA []byte) (int, error)

func (*Replica) ProtoMessage

func (*Replica) ProtoMessage()

func (*Replica) Reset

func (m *Replica) Reset()

func (*Replica) Size

func (m *Replica) Size() (n int)

func (*Replica) String

func (m *Replica) String() string

func (*Replica) Unmarshal

func (m *Replica) Unmarshal(dAtA []byte) error

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) Descriptor() ([]byte, []int)

func (*Route) GetLeader

func (m *Route) GetLeader() *Peer

func (*Route) GetRange

func (m *Route) GetRange() *Range

func (*Route) Marshal

func (m *Route) Marshal() (dAtA []byte, err error)

func (*Route) MarshalTo

func (m *Route) MarshalTo(dAtA []byte) (int, error)

func (*Route) ProtoMessage

func (*Route) ProtoMessage()

func (*Route) Reset

func (m *Route) Reset()

func (*Route) Size

func (m *Route) Size() (n int)

func (*Route) String

func (m *Route) String() string

func (*Route) Unmarshal

func (m *Route) Unmarshal(dAtA []byte) error

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) Descriptor() ([]byte, []int)

func (*Table) GetColumns

func (m *Table) GetColumns() []*Column

func (*Table) GetCreateTime

func (m *Table) GetCreateTime() int64

func (*Table) GetDbId

func (m *Table) GetDbId() uint64

func (*Table) GetDbName

func (m *Table) GetDbName() string

func (*Table) GetEpoch

func (m *Table) GetEpoch() *TableEpoch

func (*Table) GetExpand

func (m *Table) GetExpand() []byte

func (*Table) GetId

func (m *Table) GetId() uint64

func (*Table) GetName

func (m *Table) GetName() string

func (*Table) GetPkDupCheck

func (m *Table) GetPkDupCheck() bool

func (*Table) GetProperties

func (m *Table) GetProperties() string

func (*Table) GetRegxs

func (m *Table) GetRegxs() []*Column

func (*Table) GetStatus

func (m *Table) GetStatus() TableStatus

func (*Table) Marshal

func (m *Table) Marshal() (dAtA []byte, err error)

func (*Table) MarshalTo

func (m *Table) MarshalTo(dAtA []byte) (int, error)

func (*Table) ProtoMessage

func (*Table) ProtoMessage()

func (*Table) Reset

func (m *Table) Reset()

func (*Table) Size

func (m *Table) Size() (n int)

func (*Table) String

func (m *Table) String() string

func (*Table) Unmarshal

func (m *Table) Unmarshal(dAtA []byte) error

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) MarshalTo

func (m *TableEpoch) MarshalTo(dAtA []byte) (int, 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

Jump to

Keyboard shortcuts

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