Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Code generated by protoc-gen-go. DO NOT EDIT.
- // source: raft_rpc.proto
- package raft
- import (
- fmt "fmt"
- proto "github.com/golang/protobuf/proto"
- math "math"
- )
- // Reference imports to suppress errors if they are not otherwise used.
- var _ = proto.Marshal
- var _ = fmt.Errorf
- var _ = math.Inf
- // This is a compile-time assertion to ensure that this generated file
- // is compatible with the proto package it is being compiled against.
- // A compilation error at this line likely means your copy of the
- // proto package needs to be updated.
- const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
- // A log entry in Raft can be any of any of these four types.
- type CommandType int32
- const (
- CommandType_CLIENT_REGISTRATION CommandType = 0
- CommandType_INIT CommandType = 1
- CommandType_NOOP CommandType = 2
- CommandType_STATE_MACHINE_COMMAND CommandType = 3
- )
- var CommandType_name = map[int32]string{
- 0: "CLIENT_REGISTRATION",
- 1: "INIT",
- 2: "NOOP",
- 3: "STATE_MACHINE_COMMAND",
- }
- var CommandType_value = map[string]int32{
- "CLIENT_REGISTRATION": 0,
- "INIT": 1,
- "NOOP": 2,
- "STATE_MACHINE_COMMAND": 3,
- }
- func (x CommandType) String() string {
- return proto.EnumName(CommandType_name, int32(x))
- }
- func (CommandType) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_0bd0c682ba16bf51, []int{0}
- }
- // The possible responses to a client request
- type ClientStatus int32
- const (
- ClientStatus_OK ClientStatus = 0
- ClientStatus_NOT_LEADER ClientStatus = 1
- ClientStatus_ELECTION_IN_PROGRESS ClientStatus = 2
- ClientStatus_CLUSTER_NOT_STARTED ClientStatus = 3
- ClientStatus_REQ_FAILED ClientStatus = 4
- )
- var ClientStatus_name = map[int32]string{
- 0: "OK",
- 1: "NOT_LEADER",
- 2: "ELECTION_IN_PROGRESS",
- 3: "CLUSTER_NOT_STARTED",
- 4: "REQ_FAILED",
- }
- var ClientStatus_value = map[string]int32{
- "OK": 0,
- "NOT_LEADER": 1,
- "ELECTION_IN_PROGRESS": 2,
- "CLUSTER_NOT_STARTED": 3,
- "REQ_FAILED": 4,
- }
- func (x ClientStatus) String() string {
- return proto.EnumName(ClientStatus_name, int32(x))
- }
- func (ClientStatus) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_0bd0c682ba16bf51, []int{1}
- }
- // Used to represent result of an RPC call that can either be successful or
- // unsuccessful.
- type Ok struct {
- Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
- Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *Ok) Reset() { *m = Ok{} }
- func (m *Ok) String() string { return proto.CompactTextString(m) }
- func (*Ok) ProtoMessage() {}
- func (*Ok) Descriptor() ([]byte, []int) {
- return fileDescriptor_0bd0c682ba16bf51, []int{0}
- }
- func (m *Ok) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Ok.Unmarshal(m, b)
- }
- func (m *Ok) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Ok.Marshal(b, m, deterministic)
- }
- func (m *Ok) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Ok.Merge(m, src)
- }
- func (m *Ok) XXX_Size() int {
- return xxx_messageInfo_Ok.Size(m)
- }
- func (m *Ok) XXX_DiscardUnknown() {
- xxx_messageInfo_Ok.DiscardUnknown(m)
- }
- var xxx_messageInfo_Ok proto.InternalMessageInfo
- func (m *Ok) GetOk() bool {
- if m != nil {
- return m.Ok
- }
- return false
- }
- func (m *Ok) GetReason() string {
- if m != nil {
- return m.Reason
- }
- return ""
- }
- // Represents a node in the Raft cluster
- type RemoteNode struct {
- Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"`
- Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *RemoteNode) Reset() { *m = RemoteNode{} }
- func (m *RemoteNode) String() string { return proto.CompactTextString(m) }
- func (*RemoteNode) ProtoMessage() {}
- func (*RemoteNode) Descriptor() ([]byte, []int) {
- return fileDescriptor_0bd0c682ba16bf51, []int{1}
- }
- func (m *RemoteNode) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_RemoteNode.Unmarshal(m, b)
- }
- func (m *RemoteNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_RemoteNode.Marshal(b, m, deterministic)
- }
- func (m *RemoteNode) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RemoteNode.Merge(m, src)
- }
- func (m *RemoteNode) XXX_Size() int {
- return xxx_messageInfo_RemoteNode.Size(m)
- }
- func (m *RemoteNode) XXX_DiscardUnknown() {
- xxx_messageInfo_RemoteNode.DiscardUnknown(m)
- }
- var xxx_messageInfo_RemoteNode proto.InternalMessageInfo
- func (m *RemoteNode) GetAddr() string {
- if m != nil {
- return m.Addr
- }
- return ""
- }
- func (m *RemoteNode) GetId() string {
- if m != nil {
- return m.Id
- }
- return ""
- }
- type StartNodeRequest struct {
- // The node sending the request to start another node in the cluster
- FromNode *RemoteNode `protobuf:"bytes,1,opt,name=fromNode,proto3" json:"fromNode,omitempty"`
- // The list of nodes in the cluster that the new node should start up with
- NodeList []*RemoteNode `protobuf:"bytes,2,rep,name=nodeList,proto3" json:"nodeList,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *StartNodeRequest) Reset() { *m = StartNodeRequest{} }
- func (m *StartNodeRequest) String() string { return proto.CompactTextString(m) }
- func (*StartNodeRequest) ProtoMessage() {}
- func (*StartNodeRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_0bd0c682ba16bf51, []int{2}
- }
- func (m *StartNodeRequest) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_StartNodeRequest.Unmarshal(m, b)
- }
- func (m *StartNodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_StartNodeRequest.Marshal(b, m, deterministic)
- }
- func (m *StartNodeRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_StartNodeRequest.Merge(m, src)
- }
- func (m *StartNodeRequest) XXX_Size() int {
- return xxx_messageInfo_StartNodeRequest.Size(m)
- }
- func (m *StartNodeRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_StartNodeRequest.DiscardUnknown(m)
- }
- var xxx_messageInfo_StartNodeRequest proto.InternalMessageInfo
- func (m *StartNodeRequest) GetFromNode() *RemoteNode {
- if m != nil {
- return m.FromNode
- }
- return nil
- }
- func (m *StartNodeRequest) GetNodeList() []*RemoteNode {
- if m != nil {
- return m.NodeList
- }
- return nil
- }
- type LogEntry struct {
- // Index of log entry (first index = 1)
- Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
- // The term that this entry was in when added
- TermId uint64 `protobuf:"varint,2,opt,name=termId,proto3" json:"termId,omitempty"`
- // Type of command associated with this entry
- Type CommandType `protobuf:"varint,3,opt,name=type,proto3,enum=raft.CommandType" json:"type,omitempty"`
- // Command associated with this log entry in the user's finite-state-machine.
- // Note that we only care about this value when type = STATE_MACHINE_COMMAND
- Command uint64 `protobuf:"varint,4,opt,name=command,proto3" json:"command,omitempty"`
- // Data associated with this log entry in the user's finite-state-machine.
- Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
- // After processing this log entry, what ID to use when caching the
- // response. Use an empty string to not cache at all
- CacheId string `protobuf:"bytes,6,opt,name=cacheId,proto3" json:"cacheId,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *LogEntry) Reset() { *m = LogEntry{} }
- func (m *LogEntry) String() string { return proto.CompactTextString(m) }
- func (*LogEntry) ProtoMessage() {}
- func (*LogEntry) Descriptor() ([]byte, []int) {
- return fileDescriptor_0bd0c682ba16bf51, []int{3}
- }
- func (m *LogEntry) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_LogEntry.Unmarshal(m, b)
- }
- func (m *LogEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_LogEntry.Marshal(b, m, deterministic)
- }
- func (m *LogEntry) XXX_Merge(src proto.Message) {
- xxx_messageInfo_LogEntry.Merge(m, src)
- }
- func (m *LogEntry) XXX_Size() int {
- return xxx_messageInfo_LogEntry.Size(m)
- }
- func (m *LogEntry) XXX_DiscardUnknown() {
- xxx_messageInfo_LogEntry.DiscardUnknown(m)
- }
- var xxx_messageInfo_LogEntry proto.InternalMessageInfo
- func (m *LogEntry) GetIndex() uint64 {
- if m != nil {
- return m.Index
- }
- return 0
- }
- func (m *LogEntry) GetTermId() uint64 {
- if m != nil {
- return m.TermId
- }
- return 0
- }
- func (m *LogEntry) GetType() CommandType {
- if m != nil {
- return m.Type
- }
- return CommandType_CLIENT_REGISTRATION
- }
- func (m *LogEntry) GetCommand() uint64 {
- if m != nil {
- return m.Command
- }
- return 0
- }
- func (m *LogEntry) GetData() []byte {
- if m != nil {
- return m.Data
- }
- return nil
- }
- func (m *LogEntry) GetCacheId() string {
- if m != nil {
- return m.CacheId
- }
- return ""
- }
- type AppendEntriesRequest struct {
- // The leader's term
- Term uint64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"`
- // Address of the leader sending this request
- Leader *RemoteNode `protobuf:"bytes,2,opt,name=leader,proto3" json:"leader,omitempty"`
- // The index of the log entry immediately preceding the new ones
- PrevLogIndex uint64 `protobuf:"varint,3,opt,name=prevLogIndex,proto3" json:"prevLogIndex,omitempty"`
- // The term of the log entry at prevLogIndex
- PrevLogTerm uint64 `protobuf:"varint,4,opt,name=prevLogTerm,proto3" json:"prevLogTerm,omitempty"`
- // The log entries the follower needs to store. Empty for heartbeat messages.
- Entries []*LogEntry `protobuf:"bytes,5,rep,name=entries,proto3" json:"entries,omitempty"`
- // The leader's commitIndex
- LeaderCommit uint64 `protobuf:"varint,6,opt,name=leaderCommit,proto3" json:"leaderCommit,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *AppendEntriesRequest) Reset() { *m = AppendEntriesRequest{} }
- func (m *AppendEntriesRequest) String() string { return proto.CompactTextString(m) }
- func (*AppendEntriesRequest) ProtoMessage() {}
- func (*AppendEntriesRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_0bd0c682ba16bf51, []int{4}
- }
- func (m *AppendEntriesRequest) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_AppendEntriesRequest.Unmarshal(m, b)
- }
- func (m *AppendEntriesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_AppendEntriesRequest.Marshal(b, m, deterministic)
- }
- func (m *AppendEntriesRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_AppendEntriesRequest.Merge(m, src)
- }
- func (m *AppendEntriesRequest) XXX_Size() int {
- return xxx_messageInfo_AppendEntriesRequest.Size(m)
- }
- func (m *AppendEntriesRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_AppendEntriesRequest.DiscardUnknown(m)
- }
- var xxx_messageInfo_AppendEntriesRequest proto.InternalMessageInfo
- func (m *AppendEntriesRequest) GetTerm() uint64 {
- if m != nil {
- return m.Term
- }
- return 0
- }
- func (m *AppendEntriesRequest) GetLeader() *RemoteNode {
- if m != nil {
- return m.Leader
- }
- return nil
- }
- func (m *AppendEntriesRequest) GetPrevLogIndex() uint64 {
- if m != nil {
- return m.PrevLogIndex
- }
- return 0
- }
- func (m *AppendEntriesRequest) GetPrevLogTerm() uint64 {
- if m != nil {
- return m.PrevLogTerm
- }
- return 0
- }
- func (m *AppendEntriesRequest) GetEntries() []*LogEntry {
- if m != nil {
- return m.Entries
- }
- return nil
- }
- func (m *AppendEntriesRequest) GetLeaderCommit() uint64 {
- if m != nil {
- return m.LeaderCommit
- }
- return 0
- }
- type AppendEntriesReply struct {
- // The current term, for leader to update itself.
- Term uint64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"`
- // True if follower contained entry matching prevLogIndex and prevLogTerm.
- Success bool `protobuf:"varint,2,opt,name=success,proto3" json:"success,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *AppendEntriesReply) Reset() { *m = AppendEntriesReply{} }
- func (m *AppendEntriesReply) String() string { return proto.CompactTextString(m) }
- func (*AppendEntriesReply) ProtoMessage() {}
- func (*AppendEntriesReply) Descriptor() ([]byte, []int) {
- return fileDescriptor_0bd0c682ba16bf51, []int{5}
- }
- func (m *AppendEntriesReply) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_AppendEntriesReply.Unmarshal(m, b)
- }
- func (m *AppendEntriesReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_AppendEntriesReply.Marshal(b, m, deterministic)
- }
- func (m *AppendEntriesReply) XXX_Merge(src proto.Message) {
- xxx_messageInfo_AppendEntriesReply.Merge(m, src)
- }
- func (m *AppendEntriesReply) XXX_Size() int {
- return xxx_messageInfo_AppendEntriesReply.Size(m)
- }
- func (m *AppendEntriesReply) XXX_DiscardUnknown() {
- xxx_messageInfo_AppendEntriesReply.DiscardUnknown(m)
- }
- var xxx_messageInfo_AppendEntriesReply proto.InternalMessageInfo
- func (m *AppendEntriesReply) GetTerm() uint64 {
- if m != nil {
- return m.Term
- }
- return 0
- }
- func (m *AppendEntriesReply) GetSuccess() bool {
- if m != nil {
- return m.Success
- }
- return false
- }
- type RequestVoteRequest struct {
- // The candidate's current term Id
- Term uint64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"`
- // The cadidate Id currently requesting a node to vote for it.
- Candidate *RemoteNode `protobuf:"bytes,2,opt,name=candidate,proto3" json:"candidate,omitempty"`
- // The index of the candidate's last log entry
- LastLogIndex uint64 `protobuf:"varint,3,opt,name=lastLogIndex,proto3" json:"lastLogIndex,omitempty"`
- // The term of the candidate's last log entry
- LastLogTerm uint64 `protobuf:"varint,4,opt,name=lastLogTerm,proto3" json:"lastLogTerm,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *RequestVoteRequest) Reset() { *m = RequestVoteRequest{} }
- func (m *RequestVoteRequest) String() string { return proto.CompactTextString(m) }
- func (*RequestVoteRequest) ProtoMessage() {}
- func (*RequestVoteRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_0bd0c682ba16bf51, []int{6}
- }
- func (m *RequestVoteRequest) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_RequestVoteRequest.Unmarshal(m, b)
- }
- func (m *RequestVoteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_RequestVoteRequest.Marshal(b, m, deterministic)
- }
- func (m *RequestVoteRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RequestVoteRequest.Merge(m, src)
- }
- func (m *RequestVoteRequest) XXX_Size() int {
- return xxx_messageInfo_RequestVoteRequest.Size(m)
- }
- func (m *RequestVoteRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_RequestVoteRequest.DiscardUnknown(m)
- }
- var xxx_messageInfo_RequestVoteRequest proto.InternalMessageInfo
- func (m *RequestVoteRequest) GetTerm() uint64 {
- if m != nil {
- return m.Term
- }
- return 0
- }
- func (m *RequestVoteRequest) GetCandidate() *RemoteNode {
- if m != nil {
- return m.Candidate
- }
- return nil
- }
- func (m *RequestVoteRequest) GetLastLogIndex() uint64 {
- if m != nil {
- return m.LastLogIndex
- }
- return 0
- }
- func (m *RequestVoteRequest) GetLastLogTerm() uint64 {
- if m != nil {
- return m.LastLogTerm
- }
- return 0
- }
- type RequestVoteReply struct {
- // The current term, for candidate to update itsel
- Term uint64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"`
- // True means candidate received vote
- VoteGranted bool `protobuf:"varint,2,opt,name=voteGranted,proto3" json:"voteGranted,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *RequestVoteReply) Reset() { *m = RequestVoteReply{} }
- func (m *RequestVoteReply) String() string { return proto.CompactTextString(m) }
- func (*RequestVoteReply) ProtoMessage() {}
- func (*RequestVoteReply) Descriptor() ([]byte, []int) {
- return fileDescriptor_0bd0c682ba16bf51, []int{7}
- }
- func (m *RequestVoteReply) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_RequestVoteReply.Unmarshal(m, b)
- }
- func (m *RequestVoteReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_RequestVoteReply.Marshal(b, m, deterministic)
- }
- func (m *RequestVoteReply) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RequestVoteReply.Merge(m, src)
- }
- func (m *RequestVoteReply) XXX_Size() int {
- return xxx_messageInfo_RequestVoteReply.Size(m)
- }
- func (m *RequestVoteReply) XXX_DiscardUnknown() {
- xxx_messageInfo_RequestVoteReply.DiscardUnknown(m)
- }
- var xxx_messageInfo_RequestVoteReply proto.InternalMessageInfo
- func (m *RequestVoteReply) GetTerm() uint64 {
- if m != nil {
- return m.Term
- }
- return 0
- }
- func (m *RequestVoteReply) GetVoteGranted() bool {
- if m != nil {
- return m.VoteGranted
- }
- return false
- }
- // Empty message represents that a client needs to send no data over to
- // register itself.
- type RegisterClientRequest struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *RegisterClientRequest) Reset() { *m = RegisterClientRequest{} }
- func (m *RegisterClientRequest) String() string { return proto.CompactTextString(m) }
- func (*RegisterClientRequest) ProtoMessage() {}
- func (*RegisterClientRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_0bd0c682ba16bf51, []int{8}
- }
- func (m *RegisterClientRequest) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_RegisterClientRequest.Unmarshal(m, b)
- }
- func (m *RegisterClientRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_RegisterClientRequest.Marshal(b, m, deterministic)
- }
- func (m *RegisterClientRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RegisterClientRequest.Merge(m, src)
- }
- func (m *RegisterClientRequest) XXX_Size() int {
- return xxx_messageInfo_RegisterClientRequest.Size(m)
- }
- func (m *RegisterClientRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_RegisterClientRequest.DiscardUnknown(m)
- }
- var xxx_messageInfo_RegisterClientRequest proto.InternalMessageInfo
- type RegisterClientReply struct {
- // OK if state machine registered client
- Status ClientStatus `protobuf:"varint,1,opt,name=status,proto3,enum=raft.ClientStatus" json:"status,omitempty"`
- // Unique ID for client session
- ClientId uint64 `protobuf:"varint,2,opt,name=clientId,proto3" json:"clientId,omitempty"`
- // In cases where the client contacted a non-leader, the node should
- // reply with the correct current leader.
- LeaderHint *RemoteNode `protobuf:"bytes,3,opt,name=leaderHint,proto3" json:"leaderHint,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *RegisterClientReply) Reset() { *m = RegisterClientReply{} }
- func (m *RegisterClientReply) String() string { return proto.CompactTextString(m) }
- func (*RegisterClientReply) ProtoMessage() {}
- func (*RegisterClientReply) Descriptor() ([]byte, []int) {
- return fileDescriptor_0bd0c682ba16bf51, []int{9}
- }
- func (m *RegisterClientReply) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_RegisterClientReply.Unmarshal(m, b)
- }
- func (m *RegisterClientReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_RegisterClientReply.Marshal(b, m, deterministic)
- }
- func (m *RegisterClientReply) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RegisterClientReply.Merge(m, src)
- }
- func (m *RegisterClientReply) XXX_Size() int {
- return xxx_messageInfo_RegisterClientReply.Size(m)
- }
- func (m *RegisterClientReply) XXX_DiscardUnknown() {
- xxx_messageInfo_RegisterClientReply.DiscardUnknown(m)
- }
- var xxx_messageInfo_RegisterClientReply proto.InternalMessageInfo
- func (m *RegisterClientReply) GetStatus() ClientStatus {
- if m != nil {
- return m.Status
- }
- return ClientStatus_OK
- }
- func (m *RegisterClientReply) GetClientId() uint64 {
- if m != nil {
- return m.ClientId
- }
- return 0
- }
- func (m *RegisterClientReply) GetLeaderHint() *RemoteNode {
- if m != nil {
- return m.LeaderHint
- }
- return nil
- }
- type ClientRequest struct {
- // The unique client ID associated with this client session (received
- // via a previous RegisterClient call).
- ClientId uint64 `protobuf:"varint,1,opt,name=clientId,proto3" json:"clientId,omitempty"`
- // A sequence number is associated to request to avoid duplicates
- SequenceNum uint64 `protobuf:"varint,2,opt,name=sequenceNum,proto3" json:"sequenceNum,omitempty"`
- // Command to be executed on the state machine; it may affect state
- StateMachineCmd uint64 `protobuf:"varint,4,opt,name=stateMachineCmd,proto3" json:"stateMachineCmd,omitempty"`
- // Data to accompany the command to the state machine; it may affect state
- Data []byte `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *ClientRequest) Reset() { *m = ClientRequest{} }
- func (m *ClientRequest) String() string { return proto.CompactTextString(m) }
- func (*ClientRequest) ProtoMessage() {}
- func (*ClientRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_0bd0c682ba16bf51, []int{10}
- }
- func (m *ClientRequest) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ClientRequest.Unmarshal(m, b)
- }
- func (m *ClientRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ClientRequest.Marshal(b, m, deterministic)
- }
- func (m *ClientRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ClientRequest.Merge(m, src)
- }
- func (m *ClientRequest) XXX_Size() int {
- return xxx_messageInfo_ClientRequest.Size(m)
- }
- func (m *ClientRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ClientRequest.DiscardUnknown(m)
- }
- var xxx_messageInfo_ClientRequest proto.InternalMessageInfo
- func (m *ClientRequest) GetClientId() uint64 {
- if m != nil {
- return m.ClientId
- }
- return 0
- }
- func (m *ClientRequest) GetSequenceNum() uint64 {
- if m != nil {
- return m.SequenceNum
- }
- return 0
- }
- func (m *ClientRequest) GetStateMachineCmd() uint64 {
- if m != nil {
- return m.StateMachineCmd
- }
- return 0
- }
- func (m *ClientRequest) GetData() []byte {
- if m != nil {
- return m.Data
- }
- return nil
- }
- type ClientReply struct {
- // OK if state machine successfully applied command
- Status ClientStatus `protobuf:"varint,1,opt,name=status,proto3,enum=raft.ClientStatus" json:"status,omitempty"`
- // State machine output, if successful
- Response string `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"`
- // In cases where the client contacted a non-leader, the node should
- // reply with the correct current leader.
- LeaderHint *RemoteNode `protobuf:"bytes,3,opt,name=leaderHint,proto3" json:"leaderHint,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *ClientReply) Reset() { *m = ClientReply{} }
- func (m *ClientReply) String() string { return proto.CompactTextString(m) }
- func (*ClientReply) ProtoMessage() {}
- func (*ClientReply) Descriptor() ([]byte, []int) {
- return fileDescriptor_0bd0c682ba16bf51, []int{11}
- }
- func (m *ClientReply) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ClientReply.Unmarshal(m, b)
- }
- func (m *ClientReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ClientReply.Marshal(b, m, deterministic)
- }
- func (m *ClientReply) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ClientReply.Merge(m, src)
- }
- func (m *ClientReply) XXX_Size() int {
- return xxx_messageInfo_ClientReply.Size(m)
- }
- func (m *ClientReply) XXX_DiscardUnknown() {
- xxx_messageInfo_ClientReply.DiscardUnknown(m)
- }
- var xxx_messageInfo_ClientReply proto.InternalMessageInfo
- func (m *ClientReply) GetStatus() ClientStatus {
- if m != nil {
- return m.Status
- }
- return ClientStatus_OK
- }
- func (m *ClientReply) GetResponse() string {
- if m != nil {
- return m.Response
- }
- return ""
- }
- func (m *ClientReply) GetLeaderHint() *RemoteNode {
- if m != nil {
- return m.LeaderHint
- }
- return nil
- }
- func init() {
- proto.RegisterEnum("raft.CommandType", CommandType_name, CommandType_value)
- proto.RegisterEnum("raft.ClientStatus", ClientStatus_name, ClientStatus_value)
- proto.RegisterType((*Ok)(nil), "raft.Ok")
- proto.RegisterType((*RemoteNode)(nil), "raft.RemoteNode")
- proto.RegisterType((*StartNodeRequest)(nil), "raft.StartNodeRequest")
- proto.RegisterType((*LogEntry)(nil), "raft.LogEntry")
- proto.RegisterType((*AppendEntriesRequest)(nil), "raft.AppendEntriesRequest")
- proto.RegisterType((*AppendEntriesReply)(nil), "raft.AppendEntriesReply")
- proto.RegisterType((*RequestVoteRequest)(nil), "raft.RequestVoteRequest")
- proto.RegisterType((*RequestVoteReply)(nil), "raft.RequestVoteReply")
- proto.RegisterType((*RegisterClientRequest)(nil), "raft.RegisterClientRequest")
- proto.RegisterType((*RegisterClientReply)(nil), "raft.RegisterClientReply")
- proto.RegisterType((*ClientRequest)(nil), "raft.ClientRequest")
- proto.RegisterType((*ClientReply)(nil), "raft.ClientReply")
- }
- func init() { proto.RegisterFile("raft_rpc.proto", fileDescriptor_0bd0c682ba16bf51) }
- var fileDescriptor_0bd0c682ba16bf51 = []byte{
- // 867 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x41, 0x6f, 0xe3, 0x44,
- 0x14, 0xae, 0x1d, 0x37, 0x4d, 0x5f, 0x4a, 0xd6, 0x9d, 0x74, 0xbb, 0xde, 0x70, 0x89, 0x2c, 0x21,
- 0x45, 0xd5, 0xaa, 0x5a, 0x15, 0x71, 0x46, 0xc1, 0x35, 0xad, 0x21, 0xb1, 0xcb, 0xc4, 0xcb, 0xd5,
- 0x1a, 0xec, 0x69, 0xd7, 0x6a, 0xe2, 0x31, 0xf6, 0x74, 0x45, 0x7e, 0x01, 0x07, 0x0e, 0x1c, 0xb9,
- 0x71, 0xe5, 0xaf, 0xf1, 0x33, 0xd0, 0x8c, 0xc7, 0x59, 0x3b, 0xb8, 0x48, 0x68, 0x6f, 0xf3, 0xbe,
- 0xf7, 0xde, 0xf7, 0xbe, 0xf7, 0xc5, 0x33, 0x81, 0x51, 0x41, 0xee, 0x79, 0x54, 0xe4, 0xf1, 0x65,
- 0x5e, 0x30, 0xce, 0x90, 0x21, 0x62, 0xfb, 0x0d, 0xe8, 0xc1, 0x23, 0x1a, 0x81, 0xce, 0x1e, 0x2d,
- 0x6d, 0xaa, 0xcd, 0x06, 0x58, 0x67, 0x8f, 0xe8, 0x1c, 0xfa, 0x05, 0x25, 0x25, 0xcb, 0x2c, 0x7d,
- 0xaa, 0xcd, 0x8e, 0xb1, 0x8a, 0xec, 0xb7, 0x00, 0x98, 0x6e, 0x18, 0xa7, 0x3e, 0x4b, 0x28, 0x42,
- 0x60, 0x90, 0x24, 0x29, 0x64, 0xdf, 0x31, 0x96, 0x67, 0xc1, 0x94, 0x26, 0xaa, 0x4b, 0x4f, 0x13,
- 0x3b, 0x03, 0x73, 0xc5, 0x49, 0xc1, 0x45, 0x03, 0xa6, 0x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55, 0x38, 0xc7, 0xa1, 0x7b, 0x6d, 0xf6, 0x04, 0x05,
- 0x76, 0x7f, 0x88, 0xbe, 0x9d, 0x7b, 0x0b, 0xf7, 0xda, 0x34, 0xae, 0xfe, 0xe8, 0xc1, 0x11, 0x26,
- 0xf7, 0x1c, 0xdf, 0x39, 0xe8, 0x02, 0xe0, 0x3b, 0x96, 0x66, 0x0e, 0x59, 0xaf, 0x69, 0x81, 0xfe,
- 0xb5, 0xf9, 0x64, 0x50, 0x21, 0xc1, 0xa3, 0x7d, 0x80, 0xbe, 0x82, 0x17, 0xbb, 0x07, 0x5f, 0x35,
- 0x9c, 0x57, 0xe9, 0xfd, 0xff, 0x81, 0x56, 0xdb, 0x12, 0xc6, 0xad, 0x27, 0x42, 0xb5, 0x4e, 0xaa,
- 0x92, 0xae, 0x77, 0x72, 0x62, 0x75, 0xe6, 0xf2, 0xf5, 0xd6, 0x3e, 0x40, 0x37, 0x70, 0xda, 0xb8,
- 0x8c, 0x8a, 0xcc, 0xaa, 0x85, 0xef, 0xbf, 0x22, 0x93, 0xf3, 0x8e, 0x4c, 0x45, 0x74, 0x07, 0x67,
- 0xed, 0x1b, 0xa7, 0xb8, 0x3e, 0xaf, 0x3b, 0x3a, 0xee, 0xe9, 0xe4, 0x75, 0x77, 0xb2, 0x62, 0xfc,
- 0x1a, 0xc6, 0xad, 0x6a, 0x45, 0x38, 0x6e, 0x7e, 0x9b, 0x35, 0xd1, 0x69, 0x1b, 0x94, 0x04, 0x3f,
- 0xf5, 0xe5, 0xff, 0xf7, 0x97, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x43, 0x38, 0xc5, 0x93, 0xd1,
- 0x07, 0x00, 0x00,
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement