cluster

package
v0.0.0-...-678c32f Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDiscoveryServer

func RegisterDiscoveryServer(s *grpc.Server, srv DiscoveryServer)

func RegisterMetadataServer

func RegisterMetadataServer(s *grpc.Server, srv MetadataServer)

func RegisterRaftServer

func RegisterRaftServer(s *grpc.Server, srv RaftServer)

Types

type AckResponse

type AckResponse struct {
	Success              bool     `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AckResponse) Descriptor

func (*AckResponse) Descriptor() ([]byte, []int)

func (*AckResponse) GetSuccess

func (m *AckResponse) GetSuccess() bool

func (*AckResponse) ProtoMessage

func (*AckResponse) ProtoMessage()

func (*AckResponse) Reset

func (m *AckResponse) Reset()

func (*AckResponse) String

func (m *AckResponse) String() string

func (*AckResponse) XXX_DiscardUnknown

func (m *AckResponse) XXX_DiscardUnknown()

func (*AckResponse) XXX_Marshal

func (m *AckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AckResponse) XXX_Merge

func (m *AckResponse) XXX_Merge(src proto.Message)

func (*AckResponse) XXX_Size

func (m *AckResponse) XXX_Size() int

func (*AckResponse) XXX_Unmarshal

func (m *AckResponse) XXX_Unmarshal(b []byte) error

type AppendEntriesRequest

type AppendEntriesRequest struct {
	// Provide the current term and leader
	Term   uint64 `protobuf:"varint,1,opt,name=Term,proto3" json:"Term,omitempty"`
	Leader []byte `protobuf:"bytes,2,opt,name=Leader,proto3" json:"Leader,omitempty"`
	// Provide the previous entries for integrity checking
	PrevLogEntry uint64 `protobuf:"varint,3,opt,name=PrevLogEntry,proto3" json:"PrevLogEntry,omitempty"`
	PrevLogTerm  uint64 `protobuf:"varint,4,opt,name=PrevLogTerm,proto3" json:"PrevLogTerm,omitempty"`
	// New entries to commit
	Entries []*Log `protobuf:"bytes,5,rep,name=Entries,proto3" json:"Entries,omitempty"`
	// Commit index on the leader
	LeaderCommitIndex    uint64   `protobuf:"varint,6,opt,name=LeaderCommitIndex,proto3" json:"LeaderCommitIndex,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

AppendEntriesRequest is the command used to append entries to the replicated log.

func (*AppendEntriesRequest) Descriptor

func (*AppendEntriesRequest) Descriptor() ([]byte, []int)

func (*AppendEntriesRequest) GetEntries

func (m *AppendEntriesRequest) GetEntries() []*Log

func (*AppendEntriesRequest) GetLeader

func (m *AppendEntriesRequest) GetLeader() []byte

func (*AppendEntriesRequest) GetLeaderCommitIndex

func (m *AppendEntriesRequest) GetLeaderCommitIndex() uint64

func (*AppendEntriesRequest) GetPrevLogEntry

func (m *AppendEntriesRequest) GetPrevLogEntry() uint64

func (*AppendEntriesRequest) GetPrevLogTerm

func (m *AppendEntriesRequest) GetPrevLogTerm() uint64

func (*AppendEntriesRequest) GetTerm

func (m *AppendEntriesRequest) GetTerm() uint64

func (*AppendEntriesRequest) ProtoMessage

func (*AppendEntriesRequest) ProtoMessage()

func (*AppendEntriesRequest) Reset

func (m *AppendEntriesRequest) Reset()

func (*AppendEntriesRequest) String

func (m *AppendEntriesRequest) String() string

func (*AppendEntriesRequest) XXX_DiscardUnknown

func (m *AppendEntriesRequest) XXX_DiscardUnknown()

func (*AppendEntriesRequest) XXX_Marshal

func (m *AppendEntriesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AppendEntriesRequest) XXX_Merge

func (m *AppendEntriesRequest) XXX_Merge(src proto.Message)

func (*AppendEntriesRequest) XXX_Size

func (m *AppendEntriesRequest) XXX_Size() int

func (*AppendEntriesRequest) XXX_Unmarshal

func (m *AppendEntriesRequest) XXX_Unmarshal(b []byte) error

type AppendEntriesResponse

type AppendEntriesResponse struct {
	// Newer term if leader is out of date
	Term uint64 `protobuf:"varint,1,opt,name=Term,proto3" json:"Term,omitempty"`
	// Last Log is a hint to help accelerate rebuilding slow nodes
	LastLog uint64 `protobuf:"varint,2,opt,name=LastLog,proto3" json:"LastLog,omitempty"`
	// We may not succeed if we have a conflicting entry
	Success bool `protobuf:"varint,3,opt,name=Success,proto3" json:"Success,omitempty"`
	// There are scenarios where this request didn't succeed
	// but there's no need to wait/back-off the next attempt.
	NoRetryBackoff       bool     `protobuf:"varint,4,opt,name=NoRetryBackoff,proto3" json:"NoRetryBackoff,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

AppendEntriesResponse is the response returned from an AppendEntriesRequest.

func (*AppendEntriesResponse) Descriptor

func (*AppendEntriesResponse) Descriptor() ([]byte, []int)

func (*AppendEntriesResponse) GetLastLog

func (m *AppendEntriesResponse) GetLastLog() uint64

func (*AppendEntriesResponse) GetNoRetryBackoff

func (m *AppendEntriesResponse) GetNoRetryBackoff() bool

func (*AppendEntriesResponse) GetSuccess

func (m *AppendEntriesResponse) GetSuccess() bool

func (*AppendEntriesResponse) GetTerm

func (m *AppendEntriesResponse) GetTerm() uint64

func (*AppendEntriesResponse) ProtoMessage

func (*AppendEntriesResponse) ProtoMessage()

func (*AppendEntriesResponse) Reset

func (m *AppendEntriesResponse) Reset()

func (*AppendEntriesResponse) String

func (m *AppendEntriesResponse) String() string

func (*AppendEntriesResponse) XXX_DiscardUnknown

func (m *AppendEntriesResponse) XXX_DiscardUnknown()

func (*AppendEntriesResponse) XXX_Marshal

func (m *AppendEntriesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AppendEntriesResponse) XXX_Merge

func (m *AppendEntriesResponse) XXX_Merge(src proto.Message)

func (*AppendEntriesResponse) XXX_Size

func (m *AppendEntriesResponse) XXX_Size() int

func (*AppendEntriesResponse) XXX_Unmarshal

func (m *AppendEntriesResponse) XXX_Unmarshal(b []byte) error

type DiscoveryClient

type DiscoveryClient interface {
	Join(ctx context.Context, in *NodeRequest, opts ...grpc.CallOption) (*AckResponse, error)
	Leave(ctx context.Context, in *NodeRequest, opts ...grpc.CallOption) (*AckResponse, error)
	Ping(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
}

DiscoveryClient is the client API for Discovery service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewDiscoveryClient

func NewDiscoveryClient(cc *grpc.ClientConn) DiscoveryClient

type DiscoveryServer

DiscoveryServer is the server API for Discovery service.

type HealthCheckRequest

type HealthCheckRequest struct {
	NodeName             string   `protobuf:"bytes,1,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"`
	NodeIp               string   `protobuf:"bytes,2,opt,name=node_ip,json=nodeIp,proto3" json:"node_ip,omitempty"`
	NodePort             uint32   `protobuf:"varint,3,opt,name=node_port,json=nodePort,proto3" json:"node_port,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HealthCheckRequest) Descriptor

func (*HealthCheckRequest) Descriptor() ([]byte, []int)

func (*HealthCheckRequest) GetNodeIp

func (m *HealthCheckRequest) GetNodeIp() string

func (*HealthCheckRequest) GetNodeName

func (m *HealthCheckRequest) GetNodeName() string

func (*HealthCheckRequest) GetNodePort

func (m *HealthCheckRequest) GetNodePort() uint32

func (*HealthCheckRequest) ProtoMessage

func (*HealthCheckRequest) ProtoMessage()

func (*HealthCheckRequest) Reset

func (m *HealthCheckRequest) Reset()

func (*HealthCheckRequest) String

func (m *HealthCheckRequest) String() string

func (*HealthCheckRequest) XXX_DiscardUnknown

func (m *HealthCheckRequest) XXX_DiscardUnknown()

func (*HealthCheckRequest) XXX_Marshal

func (m *HealthCheckRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HealthCheckRequest) XXX_Merge

func (m *HealthCheckRequest) XXX_Merge(src proto.Message)

func (*HealthCheckRequest) XXX_Size

func (m *HealthCheckRequest) XXX_Size() int

func (*HealthCheckRequest) XXX_Unmarshal

func (m *HealthCheckRequest) XXX_Unmarshal(b []byte) error

type HealthCheckResponse

type HealthCheckResponse struct {
	Success              bool     `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HealthCheckResponse) Descriptor

func (*HealthCheckResponse) Descriptor() ([]byte, []int)

func (*HealthCheckResponse) GetSuccess

func (m *HealthCheckResponse) GetSuccess() bool

func (*HealthCheckResponse) ProtoMessage

func (*HealthCheckResponse) ProtoMessage()

func (*HealthCheckResponse) Reset

func (m *HealthCheckResponse) Reset()

func (*HealthCheckResponse) String

func (m *HealthCheckResponse) String() string

func (*HealthCheckResponse) XXX_DiscardUnknown

func (m *HealthCheckResponse) XXX_DiscardUnknown()

func (*HealthCheckResponse) XXX_Marshal

func (m *HealthCheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HealthCheckResponse) XXX_Merge

func (m *HealthCheckResponse) XXX_Merge(src proto.Message)

func (*HealthCheckResponse) XXX_Size

func (m *HealthCheckResponse) XXX_Size() int

func (*HealthCheckResponse) XXX_Unmarshal

func (m *HealthCheckResponse) XXX_Unmarshal(b []byte) error

type InstallSnapshotRequest

type InstallSnapshotRequest struct {
	Term   uint64 `protobuf:"varint,1,opt,name=Term,proto3" json:"Term,omitempty"`
	Leader []byte `protobuf:"bytes,2,opt,name=Leader,proto3" json:"Leader,omitempty"`
	// These are the last index/term included in the snapshot
	LastLogIndex uint64 `protobuf:"varint,3,opt,name=LastLogIndex,proto3" json:"LastLogIndex,omitempty"`
	LastLogTerm  uint64 `protobuf:"varint,4,opt,name=LastLogTerm,proto3" json:"LastLogTerm,omitempty"`
	// Peer Set in the snapshot
	Peers []byte `protobuf:"bytes,5,opt,name=Peers,proto3" json:"Peers,omitempty"`
	// Size of the snapshot
	Size                 int64    `protobuf:"varint,6,opt,name=Size,proto3" json:"Size,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

InstallSnapshotRequest is the command sent to a Raft peer to bootstrap its log (and state machine) from a snapshot on another peer.

func (*InstallSnapshotRequest) Descriptor

func (*InstallSnapshotRequest) Descriptor() ([]byte, []int)

func (*InstallSnapshotRequest) GetLastLogIndex

func (m *InstallSnapshotRequest) GetLastLogIndex() uint64

func (*InstallSnapshotRequest) GetLastLogTerm

func (m *InstallSnapshotRequest) GetLastLogTerm() uint64

func (*InstallSnapshotRequest) GetLeader

func (m *InstallSnapshotRequest) GetLeader() []byte

func (*InstallSnapshotRequest) GetPeers

func (m *InstallSnapshotRequest) GetPeers() []byte

func (*InstallSnapshotRequest) GetSize

func (m *InstallSnapshotRequest) GetSize() int64

func (*InstallSnapshotRequest) GetTerm

func (m *InstallSnapshotRequest) GetTerm() uint64

func (*InstallSnapshotRequest) ProtoMessage

func (*InstallSnapshotRequest) ProtoMessage()

func (*InstallSnapshotRequest) Reset

func (m *InstallSnapshotRequest) Reset()

func (*InstallSnapshotRequest) String

func (m *InstallSnapshotRequest) String() string

func (*InstallSnapshotRequest) XXX_DiscardUnknown

func (m *InstallSnapshotRequest) XXX_DiscardUnknown()

func (*InstallSnapshotRequest) XXX_Marshal

func (m *InstallSnapshotRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*InstallSnapshotRequest) XXX_Merge

func (m *InstallSnapshotRequest) XXX_Merge(src proto.Message)

func (*InstallSnapshotRequest) XXX_Size

func (m *InstallSnapshotRequest) XXX_Size() int

func (*InstallSnapshotRequest) XXX_Unmarshal

func (m *InstallSnapshotRequest) XXX_Unmarshal(b []byte) error

type InstallSnapshotResponse

type InstallSnapshotResponse struct {
	Term                 uint64   `protobuf:"varint,1,opt,name=Term,proto3" json:"Term,omitempty"`
	Success              bool     `protobuf:"varint,2,opt,name=Success,proto3" json:"Success,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

InstallSnapshotResponse is the response returned from an InstallSnapshotRequest.

func (*InstallSnapshotResponse) Descriptor

func (*InstallSnapshotResponse) Descriptor() ([]byte, []int)

func (*InstallSnapshotResponse) GetSuccess

func (m *InstallSnapshotResponse) GetSuccess() bool

func (*InstallSnapshotResponse) GetTerm

func (m *InstallSnapshotResponse) GetTerm() uint64

func (*InstallSnapshotResponse) ProtoMessage

func (*InstallSnapshotResponse) ProtoMessage()

func (*InstallSnapshotResponse) Reset

func (m *InstallSnapshotResponse) Reset()

func (*InstallSnapshotResponse) String

func (m *InstallSnapshotResponse) String() string

func (*InstallSnapshotResponse) XXX_DiscardUnknown

func (m *InstallSnapshotResponse) XXX_DiscardUnknown()

func (*InstallSnapshotResponse) XXX_Marshal

func (m *InstallSnapshotResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*InstallSnapshotResponse) XXX_Merge

func (m *InstallSnapshotResponse) XXX_Merge(src proto.Message)

func (*InstallSnapshotResponse) XXX_Size

func (m *InstallSnapshotResponse) XXX_Size() int

func (*InstallSnapshotResponse) XXX_Unmarshal

func (m *InstallSnapshotResponse) XXX_Unmarshal(b []byte) error

type Log

type Log struct {
	// Index holds the index of the log entry.
	Index uint64 `protobuf:"varint,1,opt,name=Index,proto3" json:"Index,omitempty"`
	// Term holds the election term of the log entry.
	Term uint64 `protobuf:"varint,2,opt,name=Term,proto3" json:"Term,omitempty"`
	// Type holds the type of the log entry.
	Type uint32 `protobuf:"varint,3,opt,name=Type,proto3" json:"Type,omitempty"`
	// Data holds the log entry's type-specific data.
	Data []byte `protobuf:"bytes,4,opt,name=Data,proto3" json:"Data,omitempty"`
	// peer is not exported since it is not transmitted, only used
	// internally to construct the Data field.
	Peer                 string   `protobuf:"bytes,5,opt,name=peer,proto3" json:"peer,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Log entries are replicated to all members of the Raft cluster and form the heart of the replicated state machine.

func (*Log) Descriptor

func (*Log) Descriptor() ([]byte, []int)

func (*Log) GetData

func (m *Log) GetData() []byte

func (*Log) GetIndex

func (m *Log) GetIndex() uint64

func (*Log) GetPeer

func (m *Log) GetPeer() string

func (*Log) GetTerm

func (m *Log) GetTerm() uint64

func (*Log) GetType

func (m *Log) GetType() uint32

func (*Log) ProtoMessage

func (*Log) ProtoMessage()

func (*Log) Reset

func (m *Log) Reset()

func (*Log) String

func (m *Log) String() string

func (*Log) XXX_DiscardUnknown

func (m *Log) XXX_DiscardUnknown()

func (*Log) XXX_Marshal

func (m *Log) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Log) XXX_Merge

func (m *Log) XXX_Merge(src proto.Message)

func (*Log) XXX_Size

func (m *Log) XXX_Size() int

func (*Log) XXX_Unmarshal

func (m *Log) XXX_Unmarshal(b []byte) error

type MetadataClient

type MetadataClient interface {
	Execute(ctx context.Context, in *MetadataRequest, opts ...grpc.CallOption) (*MetadataResponse, error)
}

MetadataClient is the client API for Metadata service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMetadataClient

func NewMetadataClient(cc *grpc.ClientConn) MetadataClient

type MetadataRequest

type MetadataRequest struct {
	Op                   string   `protobuf:"bytes,1,opt,name=op,proto3" json:"op,omitempty"`
	Key                  string   `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	Value                string   `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*MetadataRequest) Descriptor

func (*MetadataRequest) Descriptor() ([]byte, []int)

func (*MetadataRequest) GetKey

func (m *MetadataRequest) GetKey() string

func (*MetadataRequest) GetOp

func (m *MetadataRequest) GetOp() string

func (*MetadataRequest) GetValue

func (m *MetadataRequest) GetValue() string

func (*MetadataRequest) ProtoMessage

func (*MetadataRequest) ProtoMessage()

func (*MetadataRequest) Reset

func (m *MetadataRequest) Reset()

func (*MetadataRequest) String

func (m *MetadataRequest) String() string

func (*MetadataRequest) XXX_DiscardUnknown

func (m *MetadataRequest) XXX_DiscardUnknown()

func (*MetadataRequest) XXX_Marshal

func (m *MetadataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MetadataRequest) XXX_Merge

func (m *MetadataRequest) XXX_Merge(src proto.Message)

func (*MetadataRequest) XXX_Size

func (m *MetadataRequest) XXX_Size() int

func (*MetadataRequest) XXX_Unmarshal

func (m *MetadataRequest) XXX_Unmarshal(b []byte) error

type MetadataResponse

type MetadataResponse struct {
	Message              string   `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*MetadataResponse) Descriptor

func (*MetadataResponse) Descriptor() ([]byte, []int)

func (*MetadataResponse) GetMessage

func (m *MetadataResponse) GetMessage() string

func (*MetadataResponse) ProtoMessage

func (*MetadataResponse) ProtoMessage()

func (*MetadataResponse) Reset

func (m *MetadataResponse) Reset()

func (*MetadataResponse) String

func (m *MetadataResponse) String() string

func (*MetadataResponse) XXX_DiscardUnknown

func (m *MetadataResponse) XXX_DiscardUnknown()

func (*MetadataResponse) XXX_Marshal

func (m *MetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MetadataResponse) XXX_Merge

func (m *MetadataResponse) XXX_Merge(src proto.Message)

func (*MetadataResponse) XXX_Size

func (m *MetadataResponse) XXX_Size() int

func (*MetadataResponse) XXX_Unmarshal

func (m *MetadataResponse) XXX_Unmarshal(b []byte) error

type MetadataServer

type MetadataServer interface {
	Execute(context.Context, *MetadataRequest) (*MetadataResponse, error)
}

MetadataServer is the server API for Metadata service.

type NodeRequest

type NodeRequest struct {
	NodeName             string   `protobuf:"bytes,1,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"`
	NodeIp               string   `protobuf:"bytes,2,opt,name=node_ip,json=nodeIp,proto3" json:"node_ip,omitempty"`
	NodePort             uint32   `protobuf:"varint,3,opt,name=node_port,json=nodePort,proto3" json:"node_port,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*NodeRequest) Descriptor

func (*NodeRequest) Descriptor() ([]byte, []int)

func (*NodeRequest) GetNodeIp

func (m *NodeRequest) GetNodeIp() string

func (*NodeRequest) GetNodeName

func (m *NodeRequest) GetNodeName() string

func (*NodeRequest) GetNodePort

func (m *NodeRequest) GetNodePort() uint32

func (*NodeRequest) ProtoMessage

func (*NodeRequest) ProtoMessage()

func (*NodeRequest) Reset

func (m *NodeRequest) Reset()

func (*NodeRequest) String

func (m *NodeRequest) String() string

func (*NodeRequest) XXX_DiscardUnknown

func (m *NodeRequest) XXX_DiscardUnknown()

func (*NodeRequest) XXX_Marshal

func (m *NodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NodeRequest) XXX_Merge

func (m *NodeRequest) XXX_Merge(src proto.Message)

func (*NodeRequest) XXX_Size

func (m *NodeRequest) XXX_Size() int

func (*NodeRequest) XXX_Unmarshal

func (m *NodeRequest) XXX_Unmarshal(b []byte) error

type RaftClient

type RaftClient interface {
	AppendEntries(ctx context.Context, in *AppendEntriesRequest, opts ...grpc.CallOption) (*AppendEntriesResponse, error)
	RequestVote(ctx context.Context, in *RequestVoteRequest, opts ...grpc.CallOption) (*RequestVoteResponse, error)
	InstallSnapshot(ctx context.Context, in *InstallSnapshotRequest, opts ...grpc.CallOption) (*InstallSnapshotResponse, error)
}

RaftClient is the client API for Raft service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewRaftClient

func NewRaftClient(cc *grpc.ClientConn) RaftClient

type RaftServer

RaftServer is the server API for Raft service.

type RequestVoteRequest

type RequestVoteRequest struct {
	// Provide the term and our id
	Term      uint64 `protobuf:"varint,1,opt,name=Term,proto3" json:"Term,omitempty"`
	Candidate []byte `protobuf:"bytes,2,opt,name=Candidate,proto3" json:"Candidate,omitempty"`
	// Used to ensure safety
	LastLogIndex         uint64   `protobuf:"varint,3,opt,name=LastLogIndex,proto3" json:"LastLogIndex,omitempty"`
	LastLogTerm          uint64   `protobuf:"varint,4,opt,name=LastLogTerm,proto3" json:"LastLogTerm,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

RequestVoteRequest is the command used by a candidate to ask a Raft peer for a vote in an election.

func (*RequestVoteRequest) Descriptor

func (*RequestVoteRequest) Descriptor() ([]byte, []int)

func (*RequestVoteRequest) GetCandidate

func (m *RequestVoteRequest) GetCandidate() []byte

func (*RequestVoteRequest) GetLastLogIndex

func (m *RequestVoteRequest) GetLastLogIndex() uint64

func (*RequestVoteRequest) GetLastLogTerm

func (m *RequestVoteRequest) GetLastLogTerm() uint64

func (*RequestVoteRequest) GetTerm

func (m *RequestVoteRequest) GetTerm() uint64

func (*RequestVoteRequest) ProtoMessage

func (*RequestVoteRequest) ProtoMessage()

func (*RequestVoteRequest) Reset

func (m *RequestVoteRequest) Reset()

func (*RequestVoteRequest) String

func (m *RequestVoteRequest) String() string

func (*RequestVoteRequest) XXX_DiscardUnknown

func (m *RequestVoteRequest) XXX_DiscardUnknown()

func (*RequestVoteRequest) XXX_Marshal

func (m *RequestVoteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RequestVoteRequest) XXX_Merge

func (m *RequestVoteRequest) XXX_Merge(src proto.Message)

func (*RequestVoteRequest) XXX_Size

func (m *RequestVoteRequest) XXX_Size() int

func (*RequestVoteRequest) XXX_Unmarshal

func (m *RequestVoteRequest) XXX_Unmarshal(b []byte) error

type RequestVoteResponse

type RequestVoteResponse struct {
	// Newer term if leader is out of date
	Term uint64 `protobuf:"varint,1,opt,name=Term,proto3" json:"Term,omitempty"`
	// Return the peers, so that a node can shutdown on removal
	Peers []byte `protobuf:"bytes,2,opt,name=Peers,proto3" json:"Peers,omitempty"`
	// Is the vote granted
	Granted              bool     `protobuf:"varint,3,opt,name=Granted,proto3" json:"Granted,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

RequestVoteResponse is the response returned from a RequestVoteRequest.

func (*RequestVoteResponse) Descriptor

func (*RequestVoteResponse) Descriptor() ([]byte, []int)

func (*RequestVoteResponse) GetGranted

func (m *RequestVoteResponse) GetGranted() bool

func (*RequestVoteResponse) GetPeers

func (m *RequestVoteResponse) GetPeers() []byte

func (*RequestVoteResponse) GetTerm

func (m *RequestVoteResponse) GetTerm() uint64

func (*RequestVoteResponse) ProtoMessage

func (*RequestVoteResponse) ProtoMessage()

func (*RequestVoteResponse) Reset

func (m *RequestVoteResponse) Reset()

func (*RequestVoteResponse) String

func (m *RequestVoteResponse) String() string

func (*RequestVoteResponse) XXX_DiscardUnknown

func (m *RequestVoteResponse) XXX_DiscardUnknown()

func (*RequestVoteResponse) XXX_Marshal

func (m *RequestVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RequestVoteResponse) XXX_Merge

func (m *RequestVoteResponse) XXX_Merge(src proto.Message)

func (*RequestVoteResponse) XXX_Size

func (m *RequestVoteResponse) XXX_Size() int

func (*RequestVoteResponse) XXX_Unmarshal

func (m *RequestVoteResponse) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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