Documentation
¶
Index ¶
- Constants
- Variables
- func ConcatBytes(items ...interface{}) []byte
- func GetTruncatedHash(data []byte, size int) []byte
- func RegisterMonsteraApiServer(s grpc.ServiceRegistrar, srv MonsteraApiServer)
- func ShortenBounds(lower, upper []byte) ([]byte, []byte)
- func ValidateTransition(old, new *ClusterConfig) error
- func WriteConfigToFile(config *ClusterConfig, path string) error
- func WriteConfigToJson(config *ClusterConfig) ([]byte, error)
- func WriteConfigToProto(config *ClusterConfig) ([]byte, error)
- type AddVoterRequest
- func (*AddVoterRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AddVoterRequest) GetReplicaId() string
- func (x *AddVoterRequest) GetVoterAddress() string
- func (x *AddVoterRequest) GetVoterReplicaId() string
- func (*AddVoterRequest) ProtoMessage()
- func (x *AddVoterRequest) ProtoReflect() protoreflect.Message
- func (x *AddVoterRequest) Reset()
- func (x *AddVoterRequest) String() string
- type AddVoterResponse
- type AppendEntriesRequest
- func (*AppendEntriesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AppendEntriesRequest) GetEntries() []*Log
- func (x *AppendEntriesRequest) GetLeaderCommitIndex() uint64
- func (x *AppendEntriesRequest) GetPrevLogEntry() uint64
- func (x *AppendEntriesRequest) GetPrevLogTerm() uint64
- func (x *AppendEntriesRequest) GetRpcHeader() *RPCHeader
- func (x *AppendEntriesRequest) GetTargetReplicaId() string
- func (x *AppendEntriesRequest) GetTerm() uint64
- func (*AppendEntriesRequest) ProtoMessage()
- func (x *AppendEntriesRequest) ProtoReflect() protoreflect.Message
- func (x *AppendEntriesRequest) Reset()
- func (x *AppendEntriesRequest) String() string
- type AppendEntriesResponse
- func (*AppendEntriesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *AppendEntriesResponse) GetLastLog() uint64
- func (x *AppendEntriesResponse) GetNoRetryBackoff() bool
- func (x *AppendEntriesResponse) GetRpcHeader() *RPCHeader
- func (x *AppendEntriesResponse) GetSuccess() bool
- func (x *AppendEntriesResponse) GetTerm() uint64
- func (*AppendEntriesResponse) ProtoMessage()
- func (x *AppendEntriesResponse) ProtoReflect() protoreflect.Message
- func (x *AppendEntriesResponse) Reset()
- func (x *AppendEntriesResponse) String() string
- type Application
- func (*Application) Descriptor() ([]byte, []int)deprecated
- func (x *Application) GetImplementation() string
- func (x *Application) GetMetadata() []*Metadata
- func (x *Application) GetName() string
- func (x *Application) GetReplicationFactor() int32
- func (x *Application) GetShards() []*Shard
- func (*Application) ProtoMessage()
- func (x *Application) ProtoReflect() protoreflect.Message
- func (x *Application) Reset()
- func (x *Application) String() string
- type ApplicationCore
- type ApplicationCoreDescriptor
- type ApplicationCoreDescriptors
- type ApplicationCoreSnapshot
- type BadgerStore
- type Batch
- type ClusterConfig
- func CreateEmptyConfig() *ClusterConfig
- func LoadConfig(applications []*Application, nodes []*Node, updatedAt int64) (*ClusterConfig, error)
- func LoadConfigFromFile(path string) (*ClusterConfig, error)
- func LoadConfigFromJson(data []byte) (*ClusterConfig, error)
- func LoadConfigFromProto(data []byte) (*ClusterConfig, error)
- func (c *ClusterConfig) CreateApplication(applicationName string, implementation string, replicationFactor int32) (*Application, error)
- func (c *ClusterConfig) CreateNode(address string) (*Node, error)
- func (c *ClusterConfig) CreateReplica(applicationName string, shardId string, nodeAddress string) (*Replica, error)
- func (c *ClusterConfig) CreateShard(applicationName string, lowerBound []byte, upperBound []byte, parentId string) (*Shard, error)
- func (*ClusterConfig) Descriptor() ([]byte, []int)deprecated
- func (c *ClusterConfig) FindShard(applicationName string, shardKey []byte) (*Shard, error)
- func (x *ClusterConfig) GetApplications() []*Application
- func (x *ClusterConfig) GetMetadata() []*Metadata
- func (c *ClusterConfig) GetNode(nodeAddress string) (*Node, error)
- func (x *ClusterConfig) GetNodes() []*Node
- func (c *ClusterConfig) GetShard(shardId string) (*Shard, error)
- func (x *ClusterConfig) GetUpdatedAt() int64
- func (c *ClusterConfig) ListApplications() []*Application
- func (c *ClusterConfig) ListNodes() []*Node
- func (c *ClusterConfig) ListShards(applicationName string) ([]*Shard, error)
- func (*ClusterConfig) ProtoMessage()
- func (x *ClusterConfig) ProtoReflect() protoreflect.Message
- func (x *ClusterConfig) Reset()
- func (x *ClusterConfig) String() string
- func (c *ClusterConfig) Validate() error
- type HealthCheckRequest
- type HealthCheckResponse
- func (*HealthCheckResponse) Descriptor() ([]byte, []int)deprecated
- func (x *HealthCheckResponse) GetReplicas() []*ReplicaState
- func (*HealthCheckResponse) ProtoMessage()
- func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message
- func (x *HealthCheckResponse) Reset()
- func (x *HealthCheckResponse) String() string
- type HraftBadgerStore
- func (h *HraftBadgerStore) DeleteRange(min uint64, max uint64) error
- func (h *HraftBadgerStore) FirstIndex() (uint64, error)
- func (h *HraftBadgerStore) Get(key []byte) ([]byte, error)
- func (h *HraftBadgerStore) GetLog(index uint64, log *hraft.Log) error
- func (h *HraftBadgerStore) GetUint64(key []byte) (uint64, error)
- func (h *HraftBadgerStore) LastIndex() (uint64, error)
- func (h *HraftBadgerStore) Set(key []byte, val []byte) error
- func (h *HraftBadgerStore) SetUint64(key []byte, val uint64) error
- func (h *HraftBadgerStore) StoreLog(log *hraft.Log) error
- func (h *HraftBadgerStore) StoreLogs(logs []*hraft.Log) error
- type InstallSnapshotRequest
- func (*InstallSnapshotRequest) Descriptor() ([]byte, []int)deprecated
- func (x *InstallSnapshotRequest) GetConfiguration() []byte
- func (x *InstallSnapshotRequest) GetConfigurationIndex() uint64
- func (x *InstallSnapshotRequest) GetData() []byte
- func (x *InstallSnapshotRequest) GetLastLogIndex() uint64
- func (x *InstallSnapshotRequest) GetLastLogTerm() uint64
- func (x *InstallSnapshotRequest) GetLeader() []byte
- func (x *InstallSnapshotRequest) GetPeers() []byte
- func (x *InstallSnapshotRequest) GetRpcHeader() *RPCHeader
- func (x *InstallSnapshotRequest) GetSize() int64
- func (x *InstallSnapshotRequest) GetSnapshotVersion() int64
- func (x *InstallSnapshotRequest) GetTargetReplicaId() string
- func (x *InstallSnapshotRequest) GetTerm() uint64
- func (*InstallSnapshotRequest) ProtoMessage()
- func (x *InstallSnapshotRequest) ProtoReflect() protoreflect.Message
- func (x *InstallSnapshotRequest) Reset()
- func (x *InstallSnapshotRequest) String() string
- type InstallSnapshotResponse
- func (*InstallSnapshotResponse) Descriptor() ([]byte, []int)deprecated
- func (x *InstallSnapshotResponse) GetRpcHeader() *RPCHeader
- func (x *InstallSnapshotResponse) GetSuccess() bool
- func (x *InstallSnapshotResponse) GetTerm() uint64
- func (*InstallSnapshotResponse) ProtoMessage()
- func (x *InstallSnapshotResponse) ProtoReflect() protoreflect.Message
- func (x *InstallSnapshotResponse) Reset()
- func (x *InstallSnapshotResponse) String() string
- type KeyRange
- type LeadershipTransferRequest
- func (*LeadershipTransferRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LeadershipTransferRequest) GetReplicaId() string
- func (*LeadershipTransferRequest) ProtoMessage()
- func (x *LeadershipTransferRequest) ProtoReflect() protoreflect.Message
- func (x *LeadershipTransferRequest) Reset()
- func (x *LeadershipTransferRequest) String() string
- type LeadershipTransferResponse
- type Log
- func (*Log) Descriptor() ([]byte, []int)deprecated
- func (x *Log) GetAppendedAt() *timestamppb.Timestamp
- func (x *Log) GetData() []byte
- func (x *Log) GetExtensions() []byte
- func (x *Log) GetIndex() uint64
- func (x *Log) GetTerm() uint64
- func (x *Log) GetType() Log_LogType
- func (*Log) ProtoMessage()
- func (x *Log) ProtoReflect() protoreflect.Message
- func (x *Log) Reset()
- func (x *Log) String() string
- type Log_LogType
- func (Log_LogType) Descriptor() protoreflect.EnumDescriptor
- func (x Log_LogType) Enum() *Log_LogType
- func (Log_LogType) EnumDescriptor() ([]byte, []int)deprecated
- func (x Log_LogType) Number() protoreflect.EnumNumber
- func (x Log_LogType) String() string
- func (Log_LogType) Type() protoreflect.EnumType
- type Metadata
- type MonsteraApiClient
- type MonsteraApiServer
- type MonsteraApi_AppendEntriesPipelineClient
- type MonsteraApi_AppendEntriesPipelineServer
- type MonsteraApi_InstallSnapshotClient
- type MonsteraApi_InstallSnapshotServer
- type MonsteraClient
- func (c *MonsteraClient) LeadershipTransfer(applicationName string, shardId string, replicaId string) error
- func (c *MonsteraClient) ListShards(applicationName string) ([]*Shard, error)
- func (c *MonsteraClient) Read(ctx context.Context, applicationName string, shardKey []byte, ...) ([]byte, error)
- func (c *MonsteraClient) ReadShard(ctx context.Context, applicationName string, shardId string, ...) ([]byte, error)
- func (c *MonsteraClient) Start()
- func (c *MonsteraClient) Stop()
- func (c *MonsteraClient) TriggerSnapshot(applicationName string, shardId string, replicaId string) error
- func (c *MonsteraClient) Update(ctx context.Context, applicationName string, shardKey []byte, payload []byte) ([]byte, error)
- func (c *MonsteraClient) UpdateShard(ctx context.Context, applicationName string, shardId string, payload []byte) ([]byte, error)
- type MonsteraCommand
- type MonsteraConnectionPool
- type MonsteraNode
- func (n *MonsteraNode) AddVoter(ctx context.Context, replicaId string, voterReplicaId string, ...) error
- func (n *MonsteraNode) AppendEntries(replicaId string, request *hraft.AppendEntriesRequest) (*hraft.AppendEntriesResponse, error)
- func (n *MonsteraNode) InstallSnapshot(replicaId string, request *hraft.InstallSnapshotRequest, data io.Reader) (*hraft.InstallSnapshotResponse, error)
- func (n *MonsteraNode) LeadershipTransfer(replicaId string) error
- func (n *MonsteraNode) ListCores() []*MonsteraReplica
- func (n *MonsteraNode) NodeState() MonsteraNodeState
- func (n *MonsteraNode) Read(ctx context.Context, request *ReadRequest) ([]byte, error)
- func (n *MonsteraNode) RequestVote(ctx context.Context, replicaId string, request *hraft.RequestVoteRequest) (*hraft.RequestVoteResponse, error)
- func (n *MonsteraNode) Start()
- func (n *MonsteraNode) Stop()
- func (n *MonsteraNode) TimeoutNow(ctx context.Context, replicaId string, request *hraft.TimeoutNowRequest) (*hraft.TimeoutNowResponse, error)
- func (n *MonsteraNode) TriggerSnapshot(replicaId string) error
- func (n *MonsteraNode) Update(ctx context.Context, request *UpdateRequest) ([]byte, error)
- func (n *MonsteraNode) UpdateClusterConfig(ctx context.Context, newConfig *ClusterConfig) error
- type MonsteraNodeConfig
- type MonsteraNodeState
- type MonsteraReplica
- func (b *MonsteraReplica) AddVoter(replicaId string, address string) error
- func (b *MonsteraReplica) AppendEntries(request *hraft.AppendEntriesRequest) (*hraft.AppendEntriesResponse, error)
- func (b *MonsteraReplica) Bootstrap(servers []hraft.Server)
- func (b *MonsteraReplica) Close()
- func (b *MonsteraReplica) GetRaftLeader() (hraft.ServerAddress, hraft.ServerID)
- func (b *MonsteraReplica) GetRaftState() hraft.RaftState
- func (b *MonsteraReplica) GetRaftStats() map[string]string
- func (b *MonsteraReplica) InstallSnapshot(request *hraft.InstallSnapshotRequest, data io.Reader) (*hraft.InstallSnapshotResponse, error)
- func (b *MonsteraReplica) IsBootstrapped() bool
- func (b *MonsteraReplica) LeadershipTransfer() error
- func (b *MonsteraReplica) ListSnapshots() ([]*hraft.SnapshotMeta, error)
- func (b *MonsteraReplica) Read(request []byte) ([]byte, error)
- func (b *MonsteraReplica) RequestVote(request *hraft.RequestVoteRequest) (*hraft.RequestVoteResponse, error)
- func (b *MonsteraReplica) TimeoutNow(request *hraft.TimeoutNowRequest) (*hraft.TimeoutNowResponse, error)
- func (b *MonsteraReplica) TriggerSnapshot()
- func (b *MonsteraReplica) Update(request []byte) ([]byte, error)
- type MonsteraServer
- func (s *MonsteraServer) AddVoter(ctx context.Context, request *AddVoterRequest) (*AddVoterResponse, error)
- func (s *MonsteraServer) AppendEntries(ctx context.Context, request *AppendEntriesRequest) (*AppendEntriesResponse, error)
- func (s *MonsteraServer) AppendEntriesPipeline(stream MonsteraApi_AppendEntriesPipelineServer) error
- func (s *MonsteraServer) HealthCheck(ctx context.Context, request *HealthCheckRequest) (*HealthCheckResponse, error)
- func (s *MonsteraServer) InstallSnapshot(stream MonsteraApi_InstallSnapshotServer) error
- func (s *MonsteraServer) LeadershipTransfer(ctx context.Context, request *LeadershipTransferRequest) (*LeadershipTransferResponse, error)
- func (s *MonsteraServer) Read(ctx context.Context, request *ReadRequest) (*ReadResponse, error)
- func (s *MonsteraServer) RequestVote(ctx context.Context, request *RequestVoteRequest) (*RequestVoteResponse, error)
- func (s *MonsteraServer) TimeoutNow(ctx context.Context, request *TimeoutNowRequest) (*TimeoutNowResponse, error)
- func (s *MonsteraServer) TriggerSnapshot(ctx context.Context, request *TriggerSnapshotRequest) (*TriggerSnapshotResponse, error)
- func (s *MonsteraServer) Update(ctx context.Context, request *UpdateRequest) (*UpdateResponse, error)
- func (s *MonsteraServer) UpdateClusterConfig(ctx context.Context, request *UpdateClusterConfigRequest) (*UpdateClusterConfigResponse, error)
- type Node
- type RPCHeader
- func (*RPCHeader) Descriptor() ([]byte, []int)deprecated
- func (x *RPCHeader) GetAddr() []byte
- func (x *RPCHeader) GetId() []byte
- func (x *RPCHeader) GetProtocolVersion() int64
- func (*RPCHeader) ProtoMessage()
- func (x *RPCHeader) ProtoReflect() protoreflect.Message
- func (x *RPCHeader) Reset()
- func (x *RPCHeader) String() string
- type RaftSnapshot
- func (*RaftSnapshot) Descriptor() ([]byte, []int)deprecated
- func (x *RaftSnapshot) GetId() string
- func (x *RaftSnapshot) GetIndex() uint64
- func (x *RaftSnapshot) GetSize() int64
- func (x *RaftSnapshot) GetTerm() uint64
- func (*RaftSnapshot) ProtoMessage()
- func (x *RaftSnapshot) ProtoReflect() protoreflect.Message
- func (x *RaftSnapshot) Reset()
- func (x *RaftSnapshot) String() string
- type RaftState
- type ReadRequest
- func (*ReadRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ReadRequest) GetAllowReadFromFollowers() bool
- func (x *ReadRequest) GetApplicationName() string
- func (x *ReadRequest) GetHops() int32
- func (x *ReadRequest) GetKeyspaceName() string
- func (x *ReadRequest) GetPayload() []byte
- func (x *ReadRequest) GetReplicaId() string
- func (x *ReadRequest) GetShardId() string
- func (x *ReadRequest) GetShardKey() []byte
- func (*ReadRequest) ProtoMessage()
- func (x *ReadRequest) ProtoReflect() protoreflect.Message
- func (x *ReadRequest) Reset()
- func (x *ReadRequest) String() string
- type ReadResponse
- type Replica
- func (*Replica) Descriptor() ([]byte, []int)deprecated
- func (x *Replica) GetId() string
- func (x *Replica) GetMetadata() []*Metadata
- func (x *Replica) GetNodeAddress() string
- func (*Replica) ProtoMessage()
- func (x *Replica) ProtoReflect() protoreflect.Message
- func (x *Replica) Reset()
- func (x *Replica) String() string
- type ReplicaState
- func (*ReplicaState) Descriptor() ([]byte, []int)deprecated
- func (x *ReplicaState) GetRaftState() RaftState
- func (x *ReplicaState) GetRaftStats() map[string]string
- func (x *ReplicaState) GetReplicaId() string
- func (x *ReplicaState) GetSnapshots() []*RaftSnapshot
- func (*ReplicaState) ProtoMessage()
- func (x *ReplicaState) ProtoReflect() protoreflect.Message
- func (x *ReplicaState) Reset()
- func (x *ReplicaState) String() string
- type RequestVoteRequest
- func (*RequestVoteRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RequestVoteRequest) GetLastLogIndex() uint64
- func (x *RequestVoteRequest) GetLastLogTerm() uint64
- func (x *RequestVoteRequest) GetLeadershipTransfer() bool
- func (x *RequestVoteRequest) GetRpcHeader() *RPCHeader
- func (x *RequestVoteRequest) GetTargetReplicaId() string
- func (x *RequestVoteRequest) GetTerm() uint64
- func (*RequestVoteRequest) ProtoMessage()
- func (x *RequestVoteRequest) ProtoReflect() protoreflect.Message
- func (x *RequestVoteRequest) Reset()
- func (x *RequestVoteRequest) String() string
- type RequestVoteResponse
- func (*RequestVoteResponse) Descriptor() ([]byte, []int)deprecated
- func (x *RequestVoteResponse) GetGranted() bool
- func (x *RequestVoteResponse) GetPeers() []byte
- func (x *RequestVoteResponse) GetRpcHeader() *RPCHeader
- func (x *RequestVoteResponse) GetTerm() uint64
- func (*RequestVoteResponse) ProtoMessage()
- func (x *RequestVoteResponse) ProtoReflect() protoreflect.Message
- func (x *RequestVoteResponse) Reset()
- func (x *RequestVoteResponse) String() string
- type Shard
- func (*Shard) Descriptor() ([]byte, []int)deprecated
- func (x *Shard) GetId() string
- func (x *Shard) GetLowerBound() []byte
- func (x *Shard) GetMetadata() []*Metadata
- func (x *Shard) GetParentId() string
- func (x *Shard) GetReplicas() []*Replica
- func (x *Shard) GetUpperBound() []byte
- func (s *Shard) MarshalJSON() ([]byte, error)
- func (*Shard) ProtoMessage()
- func (x *Shard) ProtoReflect() protoreflect.Message
- func (x *Shard) Reset()
- func (x *Shard) String() string
- func (s *Shard) UnmarshalJSON(data []byte) error
- type TimeoutNowRequest
- func (*TimeoutNowRequest) Descriptor() ([]byte, []int)deprecated
- func (x *TimeoutNowRequest) GetRpcHeader() *RPCHeader
- func (x *TimeoutNowRequest) GetTargetReplicaId() string
- func (*TimeoutNowRequest) ProtoMessage()
- func (x *TimeoutNowRequest) ProtoReflect() protoreflect.Message
- func (x *TimeoutNowRequest) Reset()
- func (x *TimeoutNowRequest) String() string
- type TimeoutNowResponse
- func (*TimeoutNowResponse) Descriptor() ([]byte, []int)deprecated
- func (x *TimeoutNowResponse) GetRpcHeader() *RPCHeader
- func (*TimeoutNowResponse) ProtoMessage()
- func (x *TimeoutNowResponse) ProtoReflect() protoreflect.Message
- func (x *TimeoutNowResponse) Reset()
- func (x *TimeoutNowResponse) String() string
- type TriggerSnapshotRequest
- func (*TriggerSnapshotRequest) Descriptor() ([]byte, []int)deprecated
- func (x *TriggerSnapshotRequest) GetReplicaId() string
- func (*TriggerSnapshotRequest) ProtoMessage()
- func (x *TriggerSnapshotRequest) ProtoReflect() protoreflect.Message
- func (x *TriggerSnapshotRequest) Reset()
- func (x *TriggerSnapshotRequest) String() string
- type TriggerSnapshotResponse
- type Txn
- func (t *Txn) Commit() error
- func (t *Txn) Delete(key []byte) error
- func (t *Txn) Discard()
- func (t *Txn) EachPrefix(prefix []byte, fn func(key []byte, value []byte) (bool, error)) error
- func (t *Txn) EachPrefixKeys(prefix []byte, fn func(key []byte) (bool, error)) error
- func (t *Txn) EachRange(lowerBound []byte, upperBound []byte, reverse bool, ...) error
- func (t *Txn) Get(key []byte) ([]byte, error)
- func (t *Txn) PrefixExists(prefix []byte) (bool, error)
- func (t *Txn) Set(key []byte, value []byte) error
- type UnimplementedMonsteraApiServer
- func (UnimplementedMonsteraApiServer) AddVoter(context.Context, *AddVoterRequest) (*AddVoterResponse, error)
- func (UnimplementedMonsteraApiServer) AppendEntries(context.Context, *AppendEntriesRequest) (*AppendEntriesResponse, error)
- func (UnimplementedMonsteraApiServer) AppendEntriesPipeline(grpc.BidiStreamingServer[AppendEntriesRequest, AppendEntriesResponse]) error
- func (UnimplementedMonsteraApiServer) HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
- func (UnimplementedMonsteraApiServer) InstallSnapshot(grpc.ClientStreamingServer[InstallSnapshotRequest, InstallSnapshotResponse]) error
- func (UnimplementedMonsteraApiServer) LeadershipTransfer(context.Context, *LeadershipTransferRequest) (*LeadershipTransferResponse, error)
- func (UnimplementedMonsteraApiServer) Read(context.Context, *ReadRequest) (*ReadResponse, error)
- func (UnimplementedMonsteraApiServer) RequestVote(context.Context, *RequestVoteRequest) (*RequestVoteResponse, error)
- func (UnimplementedMonsteraApiServer) TimeoutNow(context.Context, *TimeoutNowRequest) (*TimeoutNowResponse, error)
- func (UnimplementedMonsteraApiServer) TriggerSnapshot(context.Context, *TriggerSnapshotRequest) (*TriggerSnapshotResponse, error)
- func (UnimplementedMonsteraApiServer) Update(context.Context, *UpdateRequest) (*UpdateResponse, error)
- func (UnimplementedMonsteraApiServer) UpdateClusterConfig(context.Context, *UpdateClusterConfigRequest) (*UpdateClusterConfigResponse, error)
- type UnsafeMonsteraApiServer
- type UpdateClusterConfigRequest
- func (*UpdateClusterConfigRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateClusterConfigRequest) GetConfig() *ClusterConfig
- func (*UpdateClusterConfigRequest) ProtoMessage()
- func (x *UpdateClusterConfigRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateClusterConfigRequest) Reset()
- func (x *UpdateClusterConfigRequest) String() string
- type UpdateClusterConfigResponse
- type UpdateRequest
- func (*UpdateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateRequest) GetApplicationName() string
- func (x *UpdateRequest) GetHops() int32
- func (x *UpdateRequest) GetKeyspaceName() string
- func (x *UpdateRequest) GetPayload() []byte
- func (x *UpdateRequest) GetReplicaId() string
- func (x *UpdateRequest) GetShardId() string
- func (x *UpdateRequest) GetShardKey() []byte
- func (*UpdateRequest) ProtoMessage()
- func (x *UpdateRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateRequest) Reset()
- func (x *UpdateRequest) String() string
- type UpdateResponse
Constants ¶
const ( MonsteraApi_Update_FullMethodName = "/com.evrblk.monstera.MonsteraApi/Update" MonsteraApi_Read_FullMethodName = "/com.evrblk.monstera.MonsteraApi/Read" MonsteraApi_AppendEntriesPipeline_FullMethodName = "/com.evrblk.monstera.MonsteraApi/AppendEntriesPipeline" MonsteraApi_AppendEntries_FullMethodName = "/com.evrblk.monstera.MonsteraApi/AppendEntries" MonsteraApi_RequestVote_FullMethodName = "/com.evrblk.monstera.MonsteraApi/RequestVote" MonsteraApi_TimeoutNow_FullMethodName = "/com.evrblk.monstera.MonsteraApi/TimeoutNow" MonsteraApi_InstallSnapshot_FullMethodName = "/com.evrblk.monstera.MonsteraApi/InstallSnapshot" MonsteraApi_HealthCheck_FullMethodName = "/com.evrblk.monstera.MonsteraApi/HealthCheck" MonsteraApi_LeadershipTransfer_FullMethodName = "/com.evrblk.monstera.MonsteraApi/LeadershipTransfer" MonsteraApi_TriggerSnapshot_FullMethodName = "/com.evrblk.monstera.MonsteraApi/TriggerSnapshot" MonsteraApi_AddVoter_FullMethodName = "/com.evrblk.monstera.MonsteraApi/AddVoter" MonsteraApi_UpdateClusterConfig_FullMethodName = "/com.evrblk.monstera.MonsteraApi/UpdateClusterConfig" )
const ( // KeyspacePerApplication holds the total size of an application's keyspace, currently 4 bytes. // It is used for shard bounds calculation. KeyspacePerApplication = 1 << 32 )
Variables ¶
var ( RaftState_name = map[int32]string{ 0: "RAFT_STATE_INVALID", 1: "RAFT_STATE_FOLLOWER", 2: "RAFT_STATE_LEADER", 3: "RAFT_STATE_CANDIDATE", 4: "RAFT_STATE_SHUTDOWN", } RaftState_value = map[string]int32{ "RAFT_STATE_INVALID": 0, "RAFT_STATE_FOLLOWER": 1, "RAFT_STATE_LEADER": 2, "RAFT_STATE_CANDIDATE": 3, "RAFT_STATE_SHUTDOWN": 4, } )
Enum value maps for RaftState.
var ( ErrNotFound = errors.New("not found") ErrConflict = errors.New("transaction conflict") )
var ( Log_LogType_name = map[int32]string{ 0: "LOG_TYPE_COMMAND", 1: "LOG_TYPE_NOOP", 2: "LOG_TYPE_ADD_PEER_DEPRECATED", 3: "LOG_TYPE_REMOVE_PEER_DEPRECATED", 4: "LOG_TYPE_BARRIER", 5: "LOG_TYPE_CONFIGURATION", } Log_LogType_value = map[string]int32{ "LOG_TYPE_COMMAND": 0, "LOG_TYPE_NOOP": 1, "LOG_TYPE_ADD_PEER_DEPRECATED": 2, "LOG_TYPE_REMOVE_PEER_DEPRECATED": 3, "LOG_TYPE_BARRIER": 4, "LOG_TYPE_CONFIGURATION": 5, } )
Enum value maps for Log_LogType.
var DefaultMonsteraNodeConfig = MonsteraNodeConfig{ MaxHops: 5, MaxReadTimeout: 10 * time.Second, MaxUpdateTimeout: 30 * time.Second, UseInMemoryRaftStore: false, }
var File_api_proto protoreflect.FileDescriptor
var File_config_proto protoreflect.FileDescriptor
var File_raft_proto protoreflect.FileDescriptor
var MonsteraApi_ServiceDesc = grpc.ServiceDesc{ ServiceName: "com.evrblk.monstera.MonsteraApi", HandlerType: (*MonsteraApiServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Update", Handler: _MonsteraApi_Update_Handler, }, { MethodName: "Read", Handler: _MonsteraApi_Read_Handler, }, { MethodName: "AppendEntries", Handler: _MonsteraApi_AppendEntries_Handler, }, { MethodName: "RequestVote", Handler: _MonsteraApi_RequestVote_Handler, }, { MethodName: "TimeoutNow", Handler: _MonsteraApi_TimeoutNow_Handler, }, { MethodName: "HealthCheck", Handler: _MonsteraApi_HealthCheck_Handler, }, { MethodName: "LeadershipTransfer", Handler: _MonsteraApi_LeadershipTransfer_Handler, }, { MethodName: "TriggerSnapshot", Handler: _MonsteraApi_TriggerSnapshot_Handler, }, { MethodName: "AddVoter", Handler: _MonsteraApi_AddVoter_Handler, }, { MethodName: "UpdateClusterConfig", Handler: _MonsteraApi_UpdateClusterConfig_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "AppendEntriesPipeline", Handler: _MonsteraApi_AppendEntriesPipeline_Handler, ServerStreams: true, ClientStreams: true, }, { StreamName: "InstallSnapshot", Handler: _MonsteraApi_InstallSnapshot_Handler, ClientStreams: true, }, }, Metadata: "api.proto", }
MonsteraApi_ServiceDesc is the grpc.ServiceDesc for MonsteraApi service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func ConcatBytes ¶
func ConcatBytes(items ...interface{}) []byte
func GetTruncatedHash ¶
func RegisterMonsteraApiServer ¶
func RegisterMonsteraApiServer(s grpc.ServiceRegistrar, srv MonsteraApiServer)
func ShortenBounds ¶
func ValidateTransition ¶
func ValidateTransition(old, new *ClusterConfig) error
ValidateTransition checks if the transition from old to new config is valid according to the following invariants:
- New nodes can be added, but existing nodes cannot be removed if they have at least one assigned replica in the old config.
- New applications can be added, but existing applications cannot be removed.
- Shards cannot be removed or have their IDs, bounds, or unique global index prefixes changed.
- New replicas can be added (even exceeding the replication factor), but replicas cannot be both added and removed in the same transition.
- All existing replicas must remain assigned to the same nodes (no reassignment of existing replicas).
- New config has newer UpdatedAt timestamp
Returns an error if any invariant is violated.
func WriteConfigToFile ¶
func WriteConfigToFile(config *ClusterConfig, path string) error
WriteConfigToFile writes monstera cluster config into either a binary Protobuf `.pb` or a ProtoJSON `.json` file.
func WriteConfigToJson ¶
func WriteConfigToJson(config *ClusterConfig) ([]byte, error)
func WriteConfigToProto ¶
func WriteConfigToProto(config *ClusterConfig) ([]byte, error)
Types ¶
type AddVoterRequest ¶
type AddVoterRequest struct {
ReplicaId string `protobuf:"bytes,1,opt,name=replica_id,json=replicaId,proto3" json:"replica_id,omitempty"`
VoterReplicaId string `protobuf:"bytes,2,opt,name=voter_replica_id,json=voterReplicaId,proto3" json:"voter_replica_id,omitempty"`
VoterAddress string `protobuf:"bytes,3,opt,name=voter_address,json=voterAddress,proto3" json:"voter_address,omitempty"`
// contains filtered or unexported fields
}
func (*AddVoterRequest) Descriptor
deprecated
func (*AddVoterRequest) Descriptor() ([]byte, []int)
Deprecated: Use AddVoterRequest.ProtoReflect.Descriptor instead.
func (*AddVoterRequest) GetReplicaId ¶
func (x *AddVoterRequest) GetReplicaId() string
func (*AddVoterRequest) GetVoterAddress ¶
func (x *AddVoterRequest) GetVoterAddress() string
func (*AddVoterRequest) GetVoterReplicaId ¶
func (x *AddVoterRequest) GetVoterReplicaId() string
func (*AddVoterRequest) ProtoMessage ¶
func (*AddVoterRequest) ProtoMessage()
func (*AddVoterRequest) ProtoReflect ¶
func (x *AddVoterRequest) ProtoReflect() protoreflect.Message
func (*AddVoterRequest) Reset ¶
func (x *AddVoterRequest) Reset()
func (*AddVoterRequest) String ¶
func (x *AddVoterRequest) String() string
type AddVoterResponse ¶
type AddVoterResponse struct {
// contains filtered or unexported fields
}
func (*AddVoterResponse) Descriptor
deprecated
func (*AddVoterResponse) Descriptor() ([]byte, []int)
Deprecated: Use AddVoterResponse.ProtoReflect.Descriptor instead.
func (*AddVoterResponse) ProtoMessage ¶
func (*AddVoterResponse) ProtoMessage()
func (*AddVoterResponse) ProtoReflect ¶
func (x *AddVoterResponse) ProtoReflect() protoreflect.Message
func (*AddVoterResponse) Reset ¶
func (x *AddVoterResponse) Reset()
func (*AddVoterResponse) String ¶
func (x *AddVoterResponse) String() string
type AppendEntriesRequest ¶
type AppendEntriesRequest struct {
RpcHeader *RPCHeader `protobuf:"bytes,1,opt,name=rpc_header,json=rpcHeader,proto3" json:"rpc_header,omitempty"`
Term uint64 `protobuf:"varint,2,opt,name=term,proto3" json:"term,omitempty"`
PrevLogEntry uint64 `protobuf:"varint,4,opt,name=prev_log_entry,json=prevLogEntry,proto3" json:"prev_log_entry,omitempty"`
PrevLogTerm uint64 `protobuf:"varint,5,opt,name=prev_log_term,json=prevLogTerm,proto3" json:"prev_log_term,omitempty"`
Entries []*Log `protobuf:"bytes,6,rep,name=entries,proto3" json:"entries,omitempty"`
LeaderCommitIndex uint64 `protobuf:"varint,7,opt,name=leader_commit_index,json=leaderCommitIndex,proto3" json:"leader_commit_index,omitempty"`
TargetReplicaId string `protobuf:"bytes,8,opt,name=target_replica_id,json=targetReplicaId,proto3" json:"target_replica_id,omitempty"`
// contains filtered or unexported fields
}
func (*AppendEntriesRequest) Descriptor
deprecated
func (*AppendEntriesRequest) Descriptor() ([]byte, []int)
Deprecated: Use AppendEntriesRequest.ProtoReflect.Descriptor instead.
func (*AppendEntriesRequest) GetEntries ¶
func (x *AppendEntriesRequest) GetEntries() []*Log
func (*AppendEntriesRequest) GetLeaderCommitIndex ¶
func (x *AppendEntriesRequest) GetLeaderCommitIndex() uint64
func (*AppendEntriesRequest) GetPrevLogEntry ¶
func (x *AppendEntriesRequest) GetPrevLogEntry() uint64
func (*AppendEntriesRequest) GetPrevLogTerm ¶
func (x *AppendEntriesRequest) GetPrevLogTerm() uint64
func (*AppendEntriesRequest) GetRpcHeader ¶
func (x *AppendEntriesRequest) GetRpcHeader() *RPCHeader
func (*AppendEntriesRequest) GetTargetReplicaId ¶
func (x *AppendEntriesRequest) GetTargetReplicaId() string
func (*AppendEntriesRequest) GetTerm ¶
func (x *AppendEntriesRequest) GetTerm() uint64
func (*AppendEntriesRequest) ProtoMessage ¶
func (*AppendEntriesRequest) ProtoMessage()
func (*AppendEntriesRequest) ProtoReflect ¶
func (x *AppendEntriesRequest) ProtoReflect() protoreflect.Message
func (*AppendEntriesRequest) Reset ¶
func (x *AppendEntriesRequest) Reset()
func (*AppendEntriesRequest) String ¶
func (x *AppendEntriesRequest) String() string
type AppendEntriesResponse ¶
type AppendEntriesResponse struct {
RpcHeader *RPCHeader `protobuf:"bytes,1,opt,name=rpc_header,json=rpcHeader,proto3" json:"rpc_header,omitempty"`
Term uint64 `protobuf:"varint,2,opt,name=term,proto3" json:"term,omitempty"`
LastLog uint64 `protobuf:"varint,3,opt,name=last_log,json=lastLog,proto3" json:"last_log,omitempty"`
Success bool `protobuf:"varint,4,opt,name=success,proto3" json:"success,omitempty"`
NoRetryBackoff bool `protobuf:"varint,5,opt,name=no_retry_backoff,json=noRetryBackoff,proto3" json:"no_retry_backoff,omitempty"`
// contains filtered or unexported fields
}
func (*AppendEntriesResponse) Descriptor
deprecated
func (*AppendEntriesResponse) Descriptor() ([]byte, []int)
Deprecated: Use AppendEntriesResponse.ProtoReflect.Descriptor instead.
func (*AppendEntriesResponse) GetLastLog ¶
func (x *AppendEntriesResponse) GetLastLog() uint64
func (*AppendEntriesResponse) GetNoRetryBackoff ¶
func (x *AppendEntriesResponse) GetNoRetryBackoff() bool
func (*AppendEntriesResponse) GetRpcHeader ¶
func (x *AppendEntriesResponse) GetRpcHeader() *RPCHeader
func (*AppendEntriesResponse) GetSuccess ¶
func (x *AppendEntriesResponse) GetSuccess() bool
func (*AppendEntriesResponse) GetTerm ¶
func (x *AppendEntriesResponse) GetTerm() uint64
func (*AppendEntriesResponse) ProtoMessage ¶
func (*AppendEntriesResponse) ProtoMessage()
func (*AppendEntriesResponse) ProtoReflect ¶
func (x *AppendEntriesResponse) ProtoReflect() protoreflect.Message
func (*AppendEntriesResponse) Reset ¶
func (x *AppendEntriesResponse) Reset()
func (*AppendEntriesResponse) String ¶
func (x *AppendEntriesResponse) String() string
type Application ¶
type Application struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Implementation string `protobuf:"bytes,2,opt,name=implementation,proto3" json:"implementation,omitempty"`
Shards []*Shard `protobuf:"bytes,3,rep,name=shards,proto3" json:"shards,omitempty"`
ReplicationFactor int32 `protobuf:"varint,4,opt,name=replication_factor,json=replicationFactor,proto3" json:"replication_factor,omitempty"`
Metadata []*Metadata `protobuf:"bytes,5,rep,name=metadata,proto3" json:"metadata,omitempty"`
// contains filtered or unexported fields
}
func (*Application) Descriptor
deprecated
func (*Application) Descriptor() ([]byte, []int)
Deprecated: Use Application.ProtoReflect.Descriptor instead.
func (*Application) GetImplementation ¶
func (x *Application) GetImplementation() string
func (*Application) GetMetadata ¶
func (x *Application) GetMetadata() []*Metadata
func (*Application) GetName ¶
func (x *Application) GetName() string
func (*Application) GetReplicationFactor ¶
func (x *Application) GetReplicationFactor() int32
func (*Application) GetShards ¶
func (x *Application) GetShards() []*Shard
func (*Application) ProtoMessage ¶
func (*Application) ProtoMessage()
func (*Application) ProtoReflect ¶
func (x *Application) ProtoReflect() protoreflect.Message
func (*Application) Reset ¶
func (x *Application) Reset()
func (*Application) String ¶
func (x *Application) String() string
type ApplicationCore ¶
type ApplicationCore interface {
// Read is used to read a value directly from the application core.
// Reads can be performed concurrently with updates, other reads,
// and snapshots. Read should panic on internal errors.
Read(request []byte) []byte
// Update is used to update the application core state.
// All updates are applied to the application core sequentially,
// in the order they are committed to the Raft log. This method is called
// by the Raft thread. Update should panic on internal errors.
Update(request []byte) []byte
// Snapshot returns an ApplicationCoreSnapshot used to: support Raft log compaction,
// to restore the application core to a previous state, or to bring out-of-date
// Raft followers up to a recent log index.
//
// The Snapshot implementation should return quickly, because Update can not
// be called while Snapshot is running. Generally this means Snapshot should
// only capture a pointer to the state, and any expensive IO should happen
// as part of ApplicationCoreSnapshot.Write.
//
// Update and Snapshot are always called from the same thread, but Update will
// be called concurrently with ApplicationCoreSnapshot.Write. This means the
// application core should be implemented to allow for concurrent updates while
// a snapshot is happening.
Snapshot() ApplicationCoreSnapshot // TODO partition range
// Restore is used to restore an application core from a snapshot. It is not
// called concurrently with any other command. The application core must discard
// all previous state before restoring the snapshot.
Restore(reader io.ReadCloser) error
// Close is used to clean up resources used by the application core. Do not
// clean up resources that are shared by multiple cores. Close is called
// after a shard split or a shard move while Monstera node is running, and
// is called for each core after Monstera node is shutdown.
Close()
}
ApplicationCore is the interface that must be implemented by clients to be used with Monstera framework.
type ApplicationCoreDescriptor ¶
type ApplicationCoreDescriptor struct {
// CoreFactoryFunc is a function that creates a new application core. It is called when
// Monstera node starts for every replica on this node, and also for every new replica that
// is added to the node while it is running.
CoreFactoryFunc func(shard *Shard, replica *Replica) ApplicationCore
// RestoreSnapshotOnStart is a flag that indicates if the application core should restore its
// state from a snapshot on start (via ApplicationCore.Restore). For fully in-memory applications,
// this flag should be true. For applications that are backed by an on-disk embedded storage this
// might or might not be necessary, depending on implementation.
RestoreSnapshotOnStart bool
}
ApplicationCoreDescriptor is used to register an application core with Monstera.
type ApplicationCoreDescriptors ¶
type ApplicationCoreDescriptors = map[string]ApplicationCoreDescriptor
ApplicationCoreDescriptors map is used to register application cores with Monstera. Key: the name of the application core, it should match Application.Implementation in ClusterConfig. Value: application core descriptor.
type ApplicationCoreSnapshot ¶
type BadgerStore ¶
type BadgerStore struct {
// contains filtered or unexported fields
}
func NewBadgerInMemoryStore ¶
func NewBadgerInMemoryStore() *BadgerStore
func NewBadgerStore ¶
func NewBadgerStore(dir string) *BadgerStore
func (*BadgerStore) BatchUpdate ¶
func (s *BadgerStore) BatchUpdate(fn func(batch *Batch) error) error
func (*BadgerStore) Close ¶
func (s *BadgerStore) Close()
func (*BadgerStore) DropPrefix ¶
func (s *BadgerStore) DropPrefix(prefix []byte) error
func (*BadgerStore) Flatten ¶
func (s *BadgerStore) Flatten() error
func (*BadgerStore) Update ¶
func (s *BadgerStore) Update() *Txn
func (*BadgerStore) View ¶
func (s *BadgerStore) View() *Txn
type ClusterConfig ¶
type ClusterConfig struct {
Applications []*Application `protobuf:"bytes,1,rep,name=applications,proto3" json:"applications,omitempty"`
Nodes []*Node `protobuf:"bytes,2,rep,name=nodes,proto3" json:"nodes,omitempty"`
UpdatedAt int64 `protobuf:"varint,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
Metadata []*Metadata `protobuf:"bytes,4,rep,name=metadata,proto3" json:"metadata,omitempty"`
// contains filtered or unexported fields
}
func CreateEmptyConfig ¶
func CreateEmptyConfig() *ClusterConfig
func LoadConfig ¶
func LoadConfig(applications []*Application, nodes []*Node, updatedAt int64) (*ClusterConfig, error)
LoadConfig loads monstera cluster config from separate components.
func LoadConfigFromFile ¶
func LoadConfigFromFile(path string) (*ClusterConfig, error)
LoadConfigFromFile loads monstera cluster config from either a binary Protobuf `.pb` or a ProtoJSON `.json` file.
func LoadConfigFromJson ¶
func LoadConfigFromJson(data []byte) (*ClusterConfig, error)
LoadConfigFromJson loads JSON serialized monstera cluster config.
func LoadConfigFromProto ¶
func LoadConfigFromProto(data []byte) (*ClusterConfig, error)
LoadConfigFromProto loads binary serialized Protobuf monstera cluster config.
func (*ClusterConfig) CreateApplication ¶
func (c *ClusterConfig) CreateApplication(applicationName string, implementation string, replicationFactor int32) (*Application, error)
func (*ClusterConfig) CreateNode ¶
func (c *ClusterConfig) CreateNode(address string) (*Node, error)
func (*ClusterConfig) CreateReplica ¶
func (*ClusterConfig) CreateShard ¶
func (*ClusterConfig) Descriptor
deprecated
func (*ClusterConfig) Descriptor() ([]byte, []int)
Deprecated: Use ClusterConfig.ProtoReflect.Descriptor instead.
func (*ClusterConfig) FindShard ¶
func (c *ClusterConfig) FindShard(applicationName string, shardKey []byte) (*Shard, error)
func (*ClusterConfig) GetApplications ¶
func (x *ClusterConfig) GetApplications() []*Application
func (*ClusterConfig) GetMetadata ¶
func (x *ClusterConfig) GetMetadata() []*Metadata
func (*ClusterConfig) GetNodes ¶
func (x *ClusterConfig) GetNodes() []*Node
func (*ClusterConfig) GetUpdatedAt ¶
func (x *ClusterConfig) GetUpdatedAt() int64
func (*ClusterConfig) ListApplications ¶
func (c *ClusterConfig) ListApplications() []*Application
func (*ClusterConfig) ListNodes ¶
func (c *ClusterConfig) ListNodes() []*Node
func (*ClusterConfig) ListShards ¶
func (c *ClusterConfig) ListShards(applicationName string) ([]*Shard, error)
func (*ClusterConfig) ProtoMessage ¶
func (*ClusterConfig) ProtoMessage()
func (*ClusterConfig) ProtoReflect ¶
func (x *ClusterConfig) ProtoReflect() protoreflect.Message
func (*ClusterConfig) Reset ¶
func (x *ClusterConfig) Reset()
func (*ClusterConfig) String ¶
func (x *ClusterConfig) String() string
func (*ClusterConfig) Validate ¶
func (c *ClusterConfig) Validate() error
Validate checks if the config is valid according to the following invariants:
- UpdatedAt is not 0 - There are at least 3 nodes - Nodes have non-empty address - Nodes have unique addresses - Applications have non-empty names - Applications have globally unique names - Applications have non-empty implementation - Applications have replication factor of at least 3 - Shards have non-empty id - Shards have globally unique ids - Shards have no overlap in range - Shards have 4 bytes ranges - All shards together cover the full range of keys - Number of replicas is greater or equal to replication factor - Replicas have non-empty id - Replicas have globally unique ids - Replicas are assigned to existing nodes - Replicas are assigned to different nodes - Metadata has unique keys
Returns an error if any invariant is violated.
type HealthCheckRequest ¶
type HealthCheckRequest struct {
// contains filtered or unexported fields
}
func (*HealthCheckRequest) Descriptor
deprecated
func (*HealthCheckRequest) Descriptor() ([]byte, []int)
Deprecated: Use HealthCheckRequest.ProtoReflect.Descriptor instead.
func (*HealthCheckRequest) ProtoMessage ¶
func (*HealthCheckRequest) ProtoMessage()
func (*HealthCheckRequest) ProtoReflect ¶
func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message
func (*HealthCheckRequest) Reset ¶
func (x *HealthCheckRequest) Reset()
func (*HealthCheckRequest) String ¶
func (x *HealthCheckRequest) String() string
type HealthCheckResponse ¶
type HealthCheckResponse struct {
Replicas []*ReplicaState `protobuf:"bytes,1,rep,name=replicas,proto3" json:"replicas,omitempty"`
// contains filtered or unexported fields
}
func (*HealthCheckResponse) Descriptor
deprecated
func (*HealthCheckResponse) Descriptor() ([]byte, []int)
Deprecated: Use HealthCheckResponse.ProtoReflect.Descriptor instead.
func (*HealthCheckResponse) GetReplicas ¶
func (x *HealthCheckResponse) GetReplicas() []*ReplicaState
func (*HealthCheckResponse) ProtoMessage ¶
func (*HealthCheckResponse) ProtoMessage()
func (*HealthCheckResponse) ProtoReflect ¶
func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message
func (*HealthCheckResponse) Reset ¶
func (x *HealthCheckResponse) Reset()
func (*HealthCheckResponse) String ¶
func (x *HealthCheckResponse) String() string
type HraftBadgerStore ¶
type HraftBadgerStore struct {
// contains filtered or unexported fields
}
func NewHraftBadgerStore ¶
func NewHraftBadgerStore(badgerStore *BadgerStore, keyPrefix []byte) *HraftBadgerStore
func (*HraftBadgerStore) DeleteRange ¶
func (h *HraftBadgerStore) DeleteRange(min uint64, max uint64) error
DeleteRange deletes a range of log entries. The range is inclusive.
func (*HraftBadgerStore) FirstIndex ¶
func (h *HraftBadgerStore) FirstIndex() (uint64, error)
FirstIndex returns the first index written. 0 for no entries.
func (*HraftBadgerStore) Get ¶
func (h *HraftBadgerStore) Get(key []byte) ([]byte, error)
Get returns the value for key, or error if key was not found.
func (*HraftBadgerStore) GetLog ¶
func (h *HraftBadgerStore) GetLog(index uint64, log *hraft.Log) error
GetLog gets a log entry at a given index.
func (*HraftBadgerStore) GetUint64 ¶
func (h *HraftBadgerStore) GetUint64(key []byte) (uint64, error)
GetUint64 returns the uint64 value for key, or error if key was not found.
func (*HraftBadgerStore) LastIndex ¶
func (h *HraftBadgerStore) LastIndex() (uint64, error)
LastIndex returns the last index written. 0 for no entries.
func (*HraftBadgerStore) SetUint64 ¶
func (h *HraftBadgerStore) SetUint64(key []byte, val uint64) error
func (*HraftBadgerStore) StoreLog ¶
func (h *HraftBadgerStore) StoreLog(log *hraft.Log) error
StoreLog stores a log entry.
func (*HraftBadgerStore) StoreLogs ¶
func (h *HraftBadgerStore) StoreLogs(logs []*hraft.Log) error
StoreLogs stores multiple log entries. By default, the logs stored may not be contiguous with previous logs (i.e. may have a gap in Index since the last log written). If an implementation can't tolerate this it may optionally implement `MonotonicLogStore` to indicate that this is not allowed. This changes Raft's behaviour after restoring a user snapshot to remove all previous logs instead of relying on a "gap" to signal the discontinuity between logs before the snapshot and logs after.
type InstallSnapshotRequest ¶
type InstallSnapshotRequest struct {
RpcHeader *RPCHeader `protobuf:"bytes,1,opt,name=rpc_header,json=rpcHeader,proto3" json:"rpc_header,omitempty"`
SnapshotVersion int64 `protobuf:"varint,11,opt,name=snapshot_version,json=snapshotVersion,proto3" json:"snapshot_version,omitempty"`
Term uint64 `protobuf:"varint,2,opt,name=term,proto3" json:"term,omitempty"`
Leader []byte `protobuf:"bytes,3,opt,name=leader,proto3" json:"leader,omitempty"`
LastLogIndex uint64 `protobuf:"varint,4,opt,name=last_log_index,json=lastLogIndex,proto3" json:"last_log_index,omitempty"`
LastLogTerm uint64 `protobuf:"varint,5,opt,name=last_log_term,json=lastLogTerm,proto3" json:"last_log_term,omitempty"`
Peers []byte `protobuf:"bytes,6,opt,name=peers,proto3" json:"peers,omitempty"`
Configuration []byte `protobuf:"bytes,7,opt,name=configuration,proto3" json:"configuration,omitempty"`
ConfigurationIndex uint64 `protobuf:"varint,8,opt,name=configuration_index,json=configurationIndex,proto3" json:"configuration_index,omitempty"`
Size int64 `protobuf:"varint,9,opt,name=size,proto3" json:"size,omitempty"`
Data []byte `protobuf:"bytes,10,opt,name=data,proto3" json:"data,omitempty"`
TargetReplicaId string `protobuf:"bytes,12,opt,name=target_replica_id,json=targetReplicaId,proto3" json:"target_replica_id,omitempty"`
// contains filtered or unexported fields
}
The first InstallSnapshotRequest on the stream contains all the metadata. All further messages contain only data.
func (*InstallSnapshotRequest) Descriptor
deprecated
func (*InstallSnapshotRequest) Descriptor() ([]byte, []int)
Deprecated: Use InstallSnapshotRequest.ProtoReflect.Descriptor instead.
func (*InstallSnapshotRequest) GetConfiguration ¶
func (x *InstallSnapshotRequest) GetConfiguration() []byte
func (*InstallSnapshotRequest) GetConfigurationIndex ¶
func (x *InstallSnapshotRequest) GetConfigurationIndex() uint64
func (*InstallSnapshotRequest) GetData ¶
func (x *InstallSnapshotRequest) GetData() []byte
func (*InstallSnapshotRequest) GetLastLogIndex ¶
func (x *InstallSnapshotRequest) GetLastLogIndex() uint64
func (*InstallSnapshotRequest) GetLastLogTerm ¶
func (x *InstallSnapshotRequest) GetLastLogTerm() uint64
func (*InstallSnapshotRequest) GetLeader ¶
func (x *InstallSnapshotRequest) GetLeader() []byte
func (*InstallSnapshotRequest) GetPeers ¶
func (x *InstallSnapshotRequest) GetPeers() []byte
func (*InstallSnapshotRequest) GetRpcHeader ¶
func (x *InstallSnapshotRequest) GetRpcHeader() *RPCHeader
func (*InstallSnapshotRequest) GetSize ¶
func (x *InstallSnapshotRequest) GetSize() int64
func (*InstallSnapshotRequest) GetSnapshotVersion ¶
func (x *InstallSnapshotRequest) GetSnapshotVersion() int64
func (*InstallSnapshotRequest) GetTargetReplicaId ¶
func (x *InstallSnapshotRequest) GetTargetReplicaId() string
func (*InstallSnapshotRequest) GetTerm ¶
func (x *InstallSnapshotRequest) GetTerm() uint64
func (*InstallSnapshotRequest) ProtoMessage ¶
func (*InstallSnapshotRequest) ProtoMessage()
func (*InstallSnapshotRequest) ProtoReflect ¶
func (x *InstallSnapshotRequest) ProtoReflect() protoreflect.Message
func (*InstallSnapshotRequest) Reset ¶
func (x *InstallSnapshotRequest) Reset()
func (*InstallSnapshotRequest) String ¶
func (x *InstallSnapshotRequest) String() string
type InstallSnapshotResponse ¶
type InstallSnapshotResponse struct {
RpcHeader *RPCHeader `protobuf:"bytes,1,opt,name=rpc_header,json=rpcHeader,proto3" json:"rpc_header,omitempty"`
Term uint64 `protobuf:"varint,2,opt,name=term,proto3" json:"term,omitempty"`
Success bool `protobuf:"varint,3,opt,name=success,proto3" json:"success,omitempty"`
// contains filtered or unexported fields
}
func (*InstallSnapshotResponse) Descriptor
deprecated
func (*InstallSnapshotResponse) Descriptor() ([]byte, []int)
Deprecated: Use InstallSnapshotResponse.ProtoReflect.Descriptor instead.
func (*InstallSnapshotResponse) GetRpcHeader ¶
func (x *InstallSnapshotResponse) GetRpcHeader() *RPCHeader
func (*InstallSnapshotResponse) GetSuccess ¶
func (x *InstallSnapshotResponse) GetSuccess() bool
func (*InstallSnapshotResponse) GetTerm ¶
func (x *InstallSnapshotResponse) GetTerm() uint64
func (*InstallSnapshotResponse) ProtoMessage ¶
func (*InstallSnapshotResponse) ProtoMessage()
func (*InstallSnapshotResponse) ProtoReflect ¶
func (x *InstallSnapshotResponse) ProtoReflect() protoreflect.Message
func (*InstallSnapshotResponse) Reset ¶
func (x *InstallSnapshotResponse) Reset()
func (*InstallSnapshotResponse) String ¶
func (x *InstallSnapshotResponse) String() string
type LeadershipTransferRequest ¶
type LeadershipTransferRequest struct {
ReplicaId string `protobuf:"bytes,1,opt,name=replica_id,json=replicaId,proto3" json:"replica_id,omitempty"`
// contains filtered or unexported fields
}
func (*LeadershipTransferRequest) Descriptor
deprecated
func (*LeadershipTransferRequest) Descriptor() ([]byte, []int)
Deprecated: Use LeadershipTransferRequest.ProtoReflect.Descriptor instead.
func (*LeadershipTransferRequest) GetReplicaId ¶
func (x *LeadershipTransferRequest) GetReplicaId() string
func (*LeadershipTransferRequest) ProtoMessage ¶
func (*LeadershipTransferRequest) ProtoMessage()
func (*LeadershipTransferRequest) ProtoReflect ¶
func (x *LeadershipTransferRequest) ProtoReflect() protoreflect.Message
func (*LeadershipTransferRequest) Reset ¶
func (x *LeadershipTransferRequest) Reset()
func (*LeadershipTransferRequest) String ¶
func (x *LeadershipTransferRequest) String() string
type LeadershipTransferResponse ¶
type LeadershipTransferResponse struct {
// contains filtered or unexported fields
}
func (*LeadershipTransferResponse) Descriptor
deprecated
func (*LeadershipTransferResponse) Descriptor() ([]byte, []int)
Deprecated: Use LeadershipTransferResponse.ProtoReflect.Descriptor instead.
func (*LeadershipTransferResponse) ProtoMessage ¶
func (*LeadershipTransferResponse) ProtoMessage()
func (*LeadershipTransferResponse) ProtoReflect ¶
func (x *LeadershipTransferResponse) ProtoReflect() protoreflect.Message
func (*LeadershipTransferResponse) Reset ¶
func (x *LeadershipTransferResponse) Reset()
func (*LeadershipTransferResponse) String ¶
func (x *LeadershipTransferResponse) String() string
type Log ¶
type Log struct {
Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
Term uint64 `protobuf:"varint,2,opt,name=term,proto3" json:"term,omitempty"`
Type Log_LogType `protobuf:"varint,3,opt,name=type,proto3,enum=com.evrblk.monstera.Log_LogType" json:"type,omitempty"`
Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
Extensions []byte `protobuf:"bytes,5,opt,name=extensions,proto3" json:"extensions,omitempty"`
AppendedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=appended_at,json=appendedAt,proto3" json:"appended_at,omitempty"`
// contains filtered or unexported fields
}
func (*Log) Descriptor
deprecated
func (*Log) GetAppendedAt ¶
func (x *Log) GetAppendedAt() *timestamppb.Timestamp
func (*Log) GetExtensions ¶
func (*Log) GetType ¶
func (x *Log) GetType() Log_LogType
func (*Log) ProtoMessage ¶
func (*Log) ProtoMessage()
func (*Log) ProtoReflect ¶
func (x *Log) ProtoReflect() protoreflect.Message
type Log_LogType ¶
type Log_LogType int32
const ( Log_LOG_TYPE_COMMAND Log_LogType = 0 Log_LOG_TYPE_NOOP Log_LogType = 1 Log_LOG_TYPE_ADD_PEER_DEPRECATED Log_LogType = 2 Log_LOG_TYPE_REMOVE_PEER_DEPRECATED Log_LogType = 3 Log_LOG_TYPE_BARRIER Log_LogType = 4 Log_LOG_TYPE_CONFIGURATION Log_LogType = 5 )
func (Log_LogType) Descriptor ¶
func (Log_LogType) Descriptor() protoreflect.EnumDescriptor
func (Log_LogType) Enum ¶
func (x Log_LogType) Enum() *Log_LogType
func (Log_LogType) EnumDescriptor
deprecated
func (Log_LogType) EnumDescriptor() ([]byte, []int)
Deprecated: Use Log_LogType.Descriptor instead.
func (Log_LogType) Number ¶
func (x Log_LogType) Number() protoreflect.EnumNumber
func (Log_LogType) String ¶
func (x Log_LogType) String() string
func (Log_LogType) Type ¶
func (Log_LogType) Type() protoreflect.EnumType
type Metadata ¶
type Metadata 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"`
// contains filtered or unexported fields
}
func (*Metadata) Descriptor
deprecated
func (*Metadata) ProtoMessage ¶
func (*Metadata) ProtoMessage()
func (*Metadata) ProtoReflect ¶
func (x *Metadata) ProtoReflect() protoreflect.Message
type MonsteraApiClient ¶
type MonsteraApiClient interface {
Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error)
Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error)
// AppendEntriesPipeline opens an AppendEntries message stream.
AppendEntriesPipeline(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[AppendEntriesRequest, AppendEntriesResponse], error)
// AppendEntries performs a single append entries request / response.
AppendEntries(ctx context.Context, in *AppendEntriesRequest, opts ...grpc.CallOption) (*AppendEntriesResponse, error)
// RequestVote is the command used by a candidate to ask a Raft peer for a
// vote in an election.
RequestVote(ctx context.Context, in *RequestVoteRequest, opts ...grpc.CallOption) (*RequestVoteResponse, error)
// TimeoutNow is used to start a leadership transfer to the target node.
TimeoutNow(ctx context.Context, in *TimeoutNowRequest, opts ...grpc.CallOption) (*TimeoutNowResponse, error)
// InstallSnapshot is the command sent to a Raft peer to bootstrap its log
// (and state machine) from a snapshot on another peer.
InstallSnapshot(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[InstallSnapshotRequest, InstallSnapshotResponse], error)
HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
LeadershipTransfer(ctx context.Context, in *LeadershipTransferRequest, opts ...grpc.CallOption) (*LeadershipTransferResponse, error)
TriggerSnapshot(ctx context.Context, in *TriggerSnapshotRequest, opts ...grpc.CallOption) (*TriggerSnapshotResponse, error)
AddVoter(ctx context.Context, in *AddVoterRequest, opts ...grpc.CallOption) (*AddVoterResponse, error)
UpdateClusterConfig(ctx context.Context, in *UpdateClusterConfigRequest, opts ...grpc.CallOption) (*UpdateClusterConfigResponse, error)
}
MonsteraApiClient is the client API for MonsteraApi service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewMonsteraApiClient ¶
func NewMonsteraApiClient(cc grpc.ClientConnInterface) MonsteraApiClient
type MonsteraApiServer ¶
type MonsteraApiServer interface {
Update(context.Context, *UpdateRequest) (*UpdateResponse, error)
Read(context.Context, *ReadRequest) (*ReadResponse, error)
// AppendEntriesPipeline opens an AppendEntries message stream.
AppendEntriesPipeline(grpc.BidiStreamingServer[AppendEntriesRequest, AppendEntriesResponse]) error
// AppendEntries performs a single append entries request / response.
AppendEntries(context.Context, *AppendEntriesRequest) (*AppendEntriesResponse, error)
// RequestVote is the command used by a candidate to ask a Raft peer for a
// vote in an election.
RequestVote(context.Context, *RequestVoteRequest) (*RequestVoteResponse, error)
// TimeoutNow is used to start a leadership transfer to the target node.
TimeoutNow(context.Context, *TimeoutNowRequest) (*TimeoutNowResponse, error)
// InstallSnapshot is the command sent to a Raft peer to bootstrap its log
// (and state machine) from a snapshot on another peer.
InstallSnapshot(grpc.ClientStreamingServer[InstallSnapshotRequest, InstallSnapshotResponse]) error
HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
LeadershipTransfer(context.Context, *LeadershipTransferRequest) (*LeadershipTransferResponse, error)
TriggerSnapshot(context.Context, *TriggerSnapshotRequest) (*TriggerSnapshotResponse, error)
AddVoter(context.Context, *AddVoterRequest) (*AddVoterResponse, error)
UpdateClusterConfig(context.Context, *UpdateClusterConfigRequest) (*UpdateClusterConfigResponse, error)
// contains filtered or unexported methods
}
MonsteraApiServer is the server API for MonsteraApi service. All implementations must embed UnimplementedMonsteraApiServer for forward compatibility.
type MonsteraApi_AppendEntriesPipelineClient ¶
type MonsteraApi_AppendEntriesPipelineClient = grpc.BidiStreamingClient[AppendEntriesRequest, AppendEntriesResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type MonsteraApi_AppendEntriesPipelineServer ¶
type MonsteraApi_AppendEntriesPipelineServer = grpc.BidiStreamingServer[AppendEntriesRequest, AppendEntriesResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type MonsteraApi_InstallSnapshotClient ¶
type MonsteraApi_InstallSnapshotClient = grpc.ClientStreamingClient[InstallSnapshotRequest, InstallSnapshotResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type MonsteraApi_InstallSnapshotServer ¶
type MonsteraApi_InstallSnapshotServer = grpc.ClientStreamingServer[InstallSnapshotRequest, InstallSnapshotResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type MonsteraClient ¶
type MonsteraClient struct {
ReplicaStates map[string]*ReplicaState
// contains filtered or unexported fields
}
func NewMonsteraClient ¶
func NewMonsteraClient(clusterConfig *ClusterConfig) *MonsteraClient
func (*MonsteraClient) LeadershipTransfer ¶
func (c *MonsteraClient) LeadershipTransfer(applicationName string, shardId string, replicaId string) error
func (*MonsteraClient) ListShards ¶
func (c *MonsteraClient) ListShards(applicationName string) ([]*Shard, error)
func (*MonsteraClient) Start ¶
func (c *MonsteraClient) Start()
func (*MonsteraClient) Stop ¶
func (c *MonsteraClient) Stop()
func (*MonsteraClient) TriggerSnapshot ¶
func (c *MonsteraClient) TriggerSnapshot(applicationName string, shardId string, replicaId string) error
func (*MonsteraClient) UpdateShard ¶
type MonsteraCommand ¶
type MonsteraCommand struct {
Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
// contains filtered or unexported fields
}
func (*MonsteraCommand) Descriptor
deprecated
func (*MonsteraCommand) Descriptor() ([]byte, []int)
Deprecated: Use MonsteraCommand.ProtoReflect.Descriptor instead.
func (*MonsteraCommand) GetPayload ¶
func (x *MonsteraCommand) GetPayload() []byte
func (*MonsteraCommand) ProtoMessage ¶
func (*MonsteraCommand) ProtoMessage()
func (*MonsteraCommand) ProtoReflect ¶
func (x *MonsteraCommand) ProtoReflect() protoreflect.Message
func (*MonsteraCommand) Reset ¶
func (x *MonsteraCommand) Reset()
func (*MonsteraCommand) String ¶
func (x *MonsteraCommand) String() string
type MonsteraConnectionPool ¶
type MonsteraConnectionPool struct {
// contains filtered or unexported fields
}
func NewMonsteraConnectionPool ¶
func NewMonsteraConnectionPool() *MonsteraConnectionPool
func (*MonsteraConnectionPool) Close ¶
func (p *MonsteraConnectionPool) Close()
func (*MonsteraConnectionPool) DeleteConnection ¶
func (p *MonsteraConnectionPool) DeleteConnection(nodeAddress string)
func (*MonsteraConnectionPool) GetConnection ¶
func (p *MonsteraConnectionPool) GetConnection(nodeAddress string) (MonsteraApiClient, error)
type MonsteraNode ¶
type MonsteraNode struct {
// contains filtered or unexported fields
}
func NewNode ¶
func NewNode(baseDir string, nodeAddress string, clusterConfig *ClusterConfig, coreDescriptors ApplicationCoreDescriptors, monsteraNodeConfig MonsteraNodeConfig) (*MonsteraNode, error)
func (*MonsteraNode) AppendEntries ¶
func (n *MonsteraNode) AppendEntries(replicaId string, request *hraft.AppendEntriesRequest) (*hraft.AppendEntriesResponse, error)
func (*MonsteraNode) InstallSnapshot ¶
func (n *MonsteraNode) InstallSnapshot(replicaId string, request *hraft.InstallSnapshotRequest, data io.Reader) (*hraft.InstallSnapshotResponse, error)
func (*MonsteraNode) LeadershipTransfer ¶
func (n *MonsteraNode) LeadershipTransfer(replicaId string) error
func (*MonsteraNode) ListCores ¶
func (n *MonsteraNode) ListCores() []*MonsteraReplica
func (*MonsteraNode) NodeState ¶
func (n *MonsteraNode) NodeState() MonsteraNodeState
func (*MonsteraNode) Read ¶
func (n *MonsteraNode) Read(ctx context.Context, request *ReadRequest) ([]byte, error)
func (*MonsteraNode) RequestVote ¶
func (n *MonsteraNode) RequestVote(ctx context.Context, replicaId string, request *hraft.RequestVoteRequest) (*hraft.RequestVoteResponse, error)
func (*MonsteraNode) Start ¶
func (n *MonsteraNode) Start()
func (*MonsteraNode) Stop ¶
func (n *MonsteraNode) Stop()
func (*MonsteraNode) TimeoutNow ¶
func (n *MonsteraNode) TimeoutNow(ctx context.Context, replicaId string, request *hraft.TimeoutNowRequest) (*hraft.TimeoutNowResponse, error)
func (*MonsteraNode) TriggerSnapshot ¶
func (n *MonsteraNode) TriggerSnapshot(replicaId string) error
func (*MonsteraNode) Update ¶
func (n *MonsteraNode) Update(ctx context.Context, request *UpdateRequest) ([]byte, error)
func (*MonsteraNode) UpdateClusterConfig ¶
func (n *MonsteraNode) UpdateClusterConfig(ctx context.Context, newConfig *ClusterConfig) error
type MonsteraNodeConfig ¶
type MonsteraNodeConfig struct {
MaxHops int32
MaxReadTimeout time.Duration
MaxUpdateTimeout time.Duration
// UseInMemoryRaftStore set to `true` should be used only in unit tests or dev environment and is not
// recommended for production use, since in-memory Raft store is not durable.
UseInMemoryRaftStore bool
}
type MonsteraNodeState ¶
type MonsteraNodeState = int
const ( INITIAL MonsteraNodeState = iota READY STOPPED )
type MonsteraReplica ¶
type MonsteraReplica struct {
ApplicationName string
ShardId string
ReplicaId string
// contains filtered or unexported fields
}
func NewMonsteraReplica ¶
func NewMonsteraReplica(baseDir string, applicationName string, shardId string, replicaId string, myAddress string, core ApplicationCore, pool *MonsteraConnectionPool, raftStore *BadgerStore, restoreSnapshotOnStart bool) *MonsteraReplica
func (*MonsteraReplica) AddVoter ¶
func (b *MonsteraReplica) AddVoter(replicaId string, address string) error
func (*MonsteraReplica) AppendEntries ¶
func (b *MonsteraReplica) AppendEntries(request *hraft.AppendEntriesRequest) (*hraft.AppendEntriesResponse, error)
func (*MonsteraReplica) Bootstrap ¶
func (b *MonsteraReplica) Bootstrap(servers []hraft.Server)
func (*MonsteraReplica) Close ¶
func (b *MonsteraReplica) Close()
func (*MonsteraReplica) GetRaftLeader ¶
func (b *MonsteraReplica) GetRaftLeader() (hraft.ServerAddress, hraft.ServerID)
func (*MonsteraReplica) GetRaftState ¶
func (b *MonsteraReplica) GetRaftState() hraft.RaftState
func (*MonsteraReplica) GetRaftStats ¶
func (b *MonsteraReplica) GetRaftStats() map[string]string
func (*MonsteraReplica) InstallSnapshot ¶
func (b *MonsteraReplica) InstallSnapshot(request *hraft.InstallSnapshotRequest, data io.Reader) (*hraft.InstallSnapshotResponse, error)
func (*MonsteraReplica) IsBootstrapped ¶
func (b *MonsteraReplica) IsBootstrapped() bool
func (*MonsteraReplica) LeadershipTransfer ¶
func (b *MonsteraReplica) LeadershipTransfer() error
func (*MonsteraReplica) ListSnapshots ¶
func (b *MonsteraReplica) ListSnapshots() ([]*hraft.SnapshotMeta, error)
func (*MonsteraReplica) RequestVote ¶
func (b *MonsteraReplica) RequestVote(request *hraft.RequestVoteRequest) (*hraft.RequestVoteResponse, error)
func (*MonsteraReplica) TimeoutNow ¶
func (b *MonsteraReplica) TimeoutNow(request *hraft.TimeoutNowRequest) (*hraft.TimeoutNowResponse, error)
func (*MonsteraReplica) TriggerSnapshot ¶
func (b *MonsteraReplica) TriggerSnapshot()
type MonsteraServer ¶
type MonsteraServer struct {
UnimplementedMonsteraApiServer
// contains filtered or unexported fields
}
func NewMonsteraServer ¶
func NewMonsteraServer(monsteraNode *MonsteraNode) *MonsteraServer
func (*MonsteraServer) AddVoter ¶
func (s *MonsteraServer) AddVoter(ctx context.Context, request *AddVoterRequest) (*AddVoterResponse, error)
func (*MonsteraServer) AppendEntries ¶
func (s *MonsteraServer) AppendEntries(ctx context.Context, request *AppendEntriesRequest) (*AppendEntriesResponse, error)
func (*MonsteraServer) AppendEntriesPipeline ¶
func (s *MonsteraServer) AppendEntriesPipeline(stream MonsteraApi_AppendEntriesPipelineServer) error
func (*MonsteraServer) HealthCheck ¶
func (s *MonsteraServer) HealthCheck(ctx context.Context, request *HealthCheckRequest) (*HealthCheckResponse, error)
func (*MonsteraServer) InstallSnapshot ¶
func (s *MonsteraServer) InstallSnapshot(stream MonsteraApi_InstallSnapshotServer) error
func (*MonsteraServer) LeadershipTransfer ¶
func (s *MonsteraServer) LeadershipTransfer(ctx context.Context, request *LeadershipTransferRequest) (*LeadershipTransferResponse, error)
func (*MonsteraServer) Read ¶
func (s *MonsteraServer) Read(ctx context.Context, request *ReadRequest) (*ReadResponse, error)
func (*MonsteraServer) RequestVote ¶
func (s *MonsteraServer) RequestVote(ctx context.Context, request *RequestVoteRequest) (*RequestVoteResponse, error)
func (*MonsteraServer) TimeoutNow ¶
func (s *MonsteraServer) TimeoutNow(ctx context.Context, request *TimeoutNowRequest) (*TimeoutNowResponse, error)
func (*MonsteraServer) TriggerSnapshot ¶
func (s *MonsteraServer) TriggerSnapshot(ctx context.Context, request *TriggerSnapshotRequest) (*TriggerSnapshotResponse, error)
func (*MonsteraServer) Update ¶
func (s *MonsteraServer) Update(ctx context.Context, request *UpdateRequest) (*UpdateResponse, error)
func (*MonsteraServer) UpdateClusterConfig ¶
func (s *MonsteraServer) UpdateClusterConfig(ctx context.Context, request *UpdateClusterConfigRequest) (*UpdateClusterConfigResponse, error)
type Node ¶
type Node struct {
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
Metadata []*Metadata `protobuf:"bytes,2,rep,name=metadata,proto3" json:"metadata,omitempty"`
// contains filtered or unexported fields
}
func (*Node) Descriptor
deprecated
func (*Node) GetAddress ¶
func (*Node) GetMetadata ¶
func (*Node) ProtoMessage ¶
func (*Node) ProtoMessage()
func (*Node) ProtoReflect ¶
func (x *Node) ProtoReflect() protoreflect.Message
type RPCHeader ¶
type RPCHeader struct {
ProtocolVersion int64 `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"`
Id []byte `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
Addr []byte `protobuf:"bytes,3,opt,name=addr,proto3" json:"addr,omitempty"`
// contains filtered or unexported fields
}
func (*RPCHeader) Descriptor
deprecated
func (*RPCHeader) GetProtocolVersion ¶
func (*RPCHeader) ProtoMessage ¶
func (*RPCHeader) ProtoMessage()
func (*RPCHeader) ProtoReflect ¶
func (x *RPCHeader) ProtoReflect() protoreflect.Message
type RaftSnapshot ¶
type RaftSnapshot struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Index uint64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"`
Term uint64 `protobuf:"varint,3,opt,name=term,proto3" json:"term,omitempty"`
Size int64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"`
// contains filtered or unexported fields
}
func (*RaftSnapshot) Descriptor
deprecated
func (*RaftSnapshot) Descriptor() ([]byte, []int)
Deprecated: Use RaftSnapshot.ProtoReflect.Descriptor instead.
func (*RaftSnapshot) GetId ¶
func (x *RaftSnapshot) GetId() string
func (*RaftSnapshot) GetIndex ¶
func (x *RaftSnapshot) GetIndex() uint64
func (*RaftSnapshot) GetSize ¶
func (x *RaftSnapshot) GetSize() int64
func (*RaftSnapshot) GetTerm ¶
func (x *RaftSnapshot) GetTerm() uint64
func (*RaftSnapshot) ProtoMessage ¶
func (*RaftSnapshot) ProtoMessage()
func (*RaftSnapshot) ProtoReflect ¶
func (x *RaftSnapshot) ProtoReflect() protoreflect.Message
func (*RaftSnapshot) Reset ¶
func (x *RaftSnapshot) Reset()
func (*RaftSnapshot) String ¶
func (x *RaftSnapshot) String() string
type RaftState ¶
type RaftState int32
func (RaftState) Descriptor ¶
func (RaftState) Descriptor() protoreflect.EnumDescriptor
func (RaftState) EnumDescriptor
deprecated
func (RaftState) Number ¶
func (x RaftState) Number() protoreflect.EnumNumber
func (RaftState) Type ¶
func (RaftState) Type() protoreflect.EnumType
type ReadRequest ¶
type ReadRequest struct {
Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
AllowReadFromFollowers bool `` /* 132-byte string literal not displayed */
ShardKey []byte `protobuf:"bytes,3,opt,name=shard_key,json=shardKey,proto3" json:"shard_key,omitempty"`
ApplicationName string `protobuf:"bytes,4,opt,name=application_name,json=applicationName,proto3" json:"application_name,omitempty"`
KeyspaceName string `protobuf:"bytes,5,opt,name=keyspace_name,json=keyspaceName,proto3" json:"keyspace_name,omitempty"`
ShardId string `protobuf:"bytes,6,opt,name=shard_id,json=shardId,proto3" json:"shard_id,omitempty"`
ReplicaId string `protobuf:"bytes,7,opt,name=replica_id,json=replicaId,proto3" json:"replica_id,omitempty"`
Hops int32 `protobuf:"varint,8,opt,name=hops,proto3" json:"hops,omitempty"`
// contains filtered or unexported fields
}
func (*ReadRequest) Descriptor
deprecated
func (*ReadRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead.
func (*ReadRequest) GetAllowReadFromFollowers ¶
func (x *ReadRequest) GetAllowReadFromFollowers() bool
func (*ReadRequest) GetApplicationName ¶
func (x *ReadRequest) GetApplicationName() string
func (*ReadRequest) GetHops ¶
func (x *ReadRequest) GetHops() int32
func (*ReadRequest) GetKeyspaceName ¶
func (x *ReadRequest) GetKeyspaceName() string
func (*ReadRequest) GetPayload ¶
func (x *ReadRequest) GetPayload() []byte
func (*ReadRequest) GetReplicaId ¶
func (x *ReadRequest) GetReplicaId() string
func (*ReadRequest) GetShardId ¶
func (x *ReadRequest) GetShardId() string
func (*ReadRequest) GetShardKey ¶
func (x *ReadRequest) GetShardKey() []byte
func (*ReadRequest) ProtoMessage ¶
func (*ReadRequest) ProtoMessage()
func (*ReadRequest) ProtoReflect ¶
func (x *ReadRequest) ProtoReflect() protoreflect.Message
func (*ReadRequest) Reset ¶
func (x *ReadRequest) Reset()
func (*ReadRequest) String ¶
func (x *ReadRequest) String() string
type ReadResponse ¶
type ReadResponse struct {
Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
// contains filtered or unexported fields
}
func (*ReadResponse) Descriptor
deprecated
func (*ReadResponse) Descriptor() ([]byte, []int)
Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead.
func (*ReadResponse) GetPayload ¶
func (x *ReadResponse) GetPayload() []byte
func (*ReadResponse) ProtoMessage ¶
func (*ReadResponse) ProtoMessage()
func (*ReadResponse) ProtoReflect ¶
func (x *ReadResponse) ProtoReflect() protoreflect.Message
func (*ReadResponse) Reset ¶
func (x *ReadResponse) Reset()
func (*ReadResponse) String ¶
func (x *ReadResponse) String() string
type Replica ¶
type Replica struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
NodeAddress string `protobuf:"bytes,2,opt,name=node_address,json=nodeAddress,proto3" json:"node_address,omitempty"`
Metadata []*Metadata `protobuf:"bytes,3,rep,name=metadata,proto3" json:"metadata,omitempty"`
// contains filtered or unexported fields
}
func (*Replica) Descriptor
deprecated
func (*Replica) GetMetadata ¶
func (*Replica) GetNodeAddress ¶
func (*Replica) ProtoMessage ¶
func (*Replica) ProtoMessage()
func (*Replica) ProtoReflect ¶
func (x *Replica) ProtoReflect() protoreflect.Message
type ReplicaState ¶
type ReplicaState struct {
ReplicaId string `protobuf:"bytes,1,opt,name=replica_id,json=replicaId,proto3" json:"replica_id,omitempty"`
RaftState RaftState `protobuf:"varint,2,opt,name=raft_state,json=raftState,proto3,enum=com.evrblk.monstera.RaftState" json:"raft_state,omitempty"`
RaftStats map[string]string `` /* 162-byte string literal not displayed */
Snapshots []*RaftSnapshot `protobuf:"bytes,4,rep,name=snapshots,proto3" json:"snapshots,omitempty"`
// contains filtered or unexported fields
}
func (*ReplicaState) Descriptor
deprecated
func (*ReplicaState) Descriptor() ([]byte, []int)
Deprecated: Use ReplicaState.ProtoReflect.Descriptor instead.
func (*ReplicaState) GetRaftState ¶
func (x *ReplicaState) GetRaftState() RaftState
func (*ReplicaState) GetRaftStats ¶
func (x *ReplicaState) GetRaftStats() map[string]string
func (*ReplicaState) GetReplicaId ¶
func (x *ReplicaState) GetReplicaId() string
func (*ReplicaState) GetSnapshots ¶
func (x *ReplicaState) GetSnapshots() []*RaftSnapshot
func (*ReplicaState) ProtoMessage ¶
func (*ReplicaState) ProtoMessage()
func (*ReplicaState) ProtoReflect ¶
func (x *ReplicaState) ProtoReflect() protoreflect.Message
func (*ReplicaState) Reset ¶
func (x *ReplicaState) Reset()
func (*ReplicaState) String ¶
func (x *ReplicaState) String() string
type RequestVoteRequest ¶
type RequestVoteRequest struct {
RpcHeader *RPCHeader `protobuf:"bytes,1,opt,name=rpc_header,json=rpcHeader,proto3" json:"rpc_header,omitempty"`
Term uint64 `protobuf:"varint,2,opt,name=term,proto3" json:"term,omitempty"`
LastLogIndex uint64 `protobuf:"varint,4,opt,name=last_log_index,json=lastLogIndex,proto3" json:"last_log_index,omitempty"`
LastLogTerm uint64 `protobuf:"varint,5,opt,name=last_log_term,json=lastLogTerm,proto3" json:"last_log_term,omitempty"`
LeadershipTransfer bool `protobuf:"varint,6,opt,name=leadership_transfer,json=leadershipTransfer,proto3" json:"leadership_transfer,omitempty"`
TargetReplicaId string `protobuf:"bytes,7,opt,name=target_replica_id,json=targetReplicaId,proto3" json:"target_replica_id,omitempty"`
// contains filtered or unexported fields
}
func (*RequestVoteRequest) Descriptor
deprecated
func (*RequestVoteRequest) Descriptor() ([]byte, []int)
Deprecated: Use RequestVoteRequest.ProtoReflect.Descriptor instead.
func (*RequestVoteRequest) GetLastLogIndex ¶
func (x *RequestVoteRequest) GetLastLogIndex() uint64
func (*RequestVoteRequest) GetLastLogTerm ¶
func (x *RequestVoteRequest) GetLastLogTerm() uint64
func (*RequestVoteRequest) GetLeadershipTransfer ¶
func (x *RequestVoteRequest) GetLeadershipTransfer() bool
func (*RequestVoteRequest) GetRpcHeader ¶
func (x *RequestVoteRequest) GetRpcHeader() *RPCHeader
func (*RequestVoteRequest) GetTargetReplicaId ¶
func (x *RequestVoteRequest) GetTargetReplicaId() string
func (*RequestVoteRequest) GetTerm ¶
func (x *RequestVoteRequest) GetTerm() uint64
func (*RequestVoteRequest) ProtoMessage ¶
func (*RequestVoteRequest) ProtoMessage()
func (*RequestVoteRequest) ProtoReflect ¶
func (x *RequestVoteRequest) ProtoReflect() protoreflect.Message
func (*RequestVoteRequest) Reset ¶
func (x *RequestVoteRequest) Reset()
func (*RequestVoteRequest) String ¶
func (x *RequestVoteRequest) String() string
type RequestVoteResponse ¶
type RequestVoteResponse struct {
RpcHeader *RPCHeader `protobuf:"bytes,1,opt,name=rpc_header,json=rpcHeader,proto3" json:"rpc_header,omitempty"`
Term uint64 `protobuf:"varint,2,opt,name=term,proto3" json:"term,omitempty"`
Peers []byte `protobuf:"bytes,3,opt,name=peers,proto3" json:"peers,omitempty"`
Granted bool `protobuf:"varint,4,opt,name=granted,proto3" json:"granted,omitempty"`
// contains filtered or unexported fields
}
func (*RequestVoteResponse) Descriptor
deprecated
func (*RequestVoteResponse) Descriptor() ([]byte, []int)
Deprecated: Use RequestVoteResponse.ProtoReflect.Descriptor instead.
func (*RequestVoteResponse) GetGranted ¶
func (x *RequestVoteResponse) GetGranted() bool
func (*RequestVoteResponse) GetPeers ¶
func (x *RequestVoteResponse) GetPeers() []byte
func (*RequestVoteResponse) GetRpcHeader ¶
func (x *RequestVoteResponse) GetRpcHeader() *RPCHeader
func (*RequestVoteResponse) GetTerm ¶
func (x *RequestVoteResponse) GetTerm() uint64
func (*RequestVoteResponse) ProtoMessage ¶
func (*RequestVoteResponse) ProtoMessage()
func (*RequestVoteResponse) ProtoReflect ¶
func (x *RequestVoteResponse) ProtoReflect() protoreflect.Message
func (*RequestVoteResponse) Reset ¶
func (x *RequestVoteResponse) Reset()
func (*RequestVoteResponse) String ¶
func (x *RequestVoteResponse) String() string
type Shard ¶
type Shard struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
LowerBound []byte `protobuf:"bytes,2,opt,name=lower_bound,json=lowerBound,proto3" json:"lower_bound,omitempty"`
UpperBound []byte `protobuf:"bytes,3,opt,name=upper_bound,json=upperBound,proto3" json:"upper_bound,omitempty"`
ParentId string `protobuf:"bytes,4,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"`
Replicas []*Replica `protobuf:"bytes,5,rep,name=replicas,proto3" json:"replicas,omitempty"`
Metadata []*Metadata `protobuf:"bytes,6,rep,name=metadata,proto3" json:"metadata,omitempty"`
// contains filtered or unexported fields
}
func (*Shard) Descriptor
deprecated
func (*Shard) GetLowerBound ¶
func (*Shard) GetMetadata ¶
func (*Shard) GetParentId ¶
func (*Shard) GetReplicas ¶
func (*Shard) GetUpperBound ¶
func (*Shard) MarshalJSON ¶
func (*Shard) ProtoMessage ¶
func (*Shard) ProtoMessage()
func (*Shard) ProtoReflect ¶
func (x *Shard) ProtoReflect() protoreflect.Message
func (*Shard) UnmarshalJSON ¶
type TimeoutNowRequest ¶
type TimeoutNowRequest struct {
RpcHeader *RPCHeader `protobuf:"bytes,1,opt,name=rpc_header,json=rpcHeader,proto3" json:"rpc_header,omitempty"`
TargetReplicaId string `protobuf:"bytes,2,opt,name=target_replica_id,json=targetReplicaId,proto3" json:"target_replica_id,omitempty"`
// contains filtered or unexported fields
}
func (*TimeoutNowRequest) Descriptor
deprecated
func (*TimeoutNowRequest) Descriptor() ([]byte, []int)
Deprecated: Use TimeoutNowRequest.ProtoReflect.Descriptor instead.
func (*TimeoutNowRequest) GetRpcHeader ¶
func (x *TimeoutNowRequest) GetRpcHeader() *RPCHeader
func (*TimeoutNowRequest) GetTargetReplicaId ¶
func (x *TimeoutNowRequest) GetTargetReplicaId() string
func (*TimeoutNowRequest) ProtoMessage ¶
func (*TimeoutNowRequest) ProtoMessage()
func (*TimeoutNowRequest) ProtoReflect ¶
func (x *TimeoutNowRequest) ProtoReflect() protoreflect.Message
func (*TimeoutNowRequest) Reset ¶
func (x *TimeoutNowRequest) Reset()
func (*TimeoutNowRequest) String ¶
func (x *TimeoutNowRequest) String() string
type TimeoutNowResponse ¶
type TimeoutNowResponse struct {
RpcHeader *RPCHeader `protobuf:"bytes,1,opt,name=rpc_header,json=rpcHeader,proto3" json:"rpc_header,omitempty"`
// contains filtered or unexported fields
}
func (*TimeoutNowResponse) Descriptor
deprecated
func (*TimeoutNowResponse) Descriptor() ([]byte, []int)
Deprecated: Use TimeoutNowResponse.ProtoReflect.Descriptor instead.
func (*TimeoutNowResponse) GetRpcHeader ¶
func (x *TimeoutNowResponse) GetRpcHeader() *RPCHeader
func (*TimeoutNowResponse) ProtoMessage ¶
func (*TimeoutNowResponse) ProtoMessage()
func (*TimeoutNowResponse) ProtoReflect ¶
func (x *TimeoutNowResponse) ProtoReflect() protoreflect.Message
func (*TimeoutNowResponse) Reset ¶
func (x *TimeoutNowResponse) Reset()
func (*TimeoutNowResponse) String ¶
func (x *TimeoutNowResponse) String() string
type TriggerSnapshotRequest ¶
type TriggerSnapshotRequest struct {
ReplicaId string `protobuf:"bytes,1,opt,name=replica_id,json=replicaId,proto3" json:"replica_id,omitempty"`
// contains filtered or unexported fields
}
func (*TriggerSnapshotRequest) Descriptor
deprecated
func (*TriggerSnapshotRequest) Descriptor() ([]byte, []int)
Deprecated: Use TriggerSnapshotRequest.ProtoReflect.Descriptor instead.
func (*TriggerSnapshotRequest) GetReplicaId ¶
func (x *TriggerSnapshotRequest) GetReplicaId() string
func (*TriggerSnapshotRequest) ProtoMessage ¶
func (*TriggerSnapshotRequest) ProtoMessage()
func (*TriggerSnapshotRequest) ProtoReflect ¶
func (x *TriggerSnapshotRequest) ProtoReflect() protoreflect.Message
func (*TriggerSnapshotRequest) Reset ¶
func (x *TriggerSnapshotRequest) Reset()
func (*TriggerSnapshotRequest) String ¶
func (x *TriggerSnapshotRequest) String() string
type TriggerSnapshotResponse ¶
type TriggerSnapshotResponse struct {
// contains filtered or unexported fields
}
func (*TriggerSnapshotResponse) Descriptor
deprecated
func (*TriggerSnapshotResponse) Descriptor() ([]byte, []int)
Deprecated: Use TriggerSnapshotResponse.ProtoReflect.Descriptor instead.
func (*TriggerSnapshotResponse) ProtoMessage ¶
func (*TriggerSnapshotResponse) ProtoMessage()
func (*TriggerSnapshotResponse) ProtoReflect ¶
func (x *TriggerSnapshotResponse) ProtoReflect() protoreflect.Message
func (*TriggerSnapshotResponse) Reset ¶
func (x *TriggerSnapshotResponse) Reset()
func (*TriggerSnapshotResponse) String ¶
func (x *TriggerSnapshotResponse) String() string
type Txn ¶
type Txn struct {
// contains filtered or unexported fields
}
func (*Txn) EachPrefix ¶
func (*Txn) EachPrefixKeys ¶
type UnimplementedMonsteraApiServer ¶
type UnimplementedMonsteraApiServer struct{}
UnimplementedMonsteraApiServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedMonsteraApiServer) AddVoter ¶
func (UnimplementedMonsteraApiServer) AddVoter(context.Context, *AddVoterRequest) (*AddVoterResponse, error)
func (UnimplementedMonsteraApiServer) AppendEntries ¶
func (UnimplementedMonsteraApiServer) AppendEntries(context.Context, *AppendEntriesRequest) (*AppendEntriesResponse, error)
func (UnimplementedMonsteraApiServer) AppendEntriesPipeline ¶
func (UnimplementedMonsteraApiServer) AppendEntriesPipeline(grpc.BidiStreamingServer[AppendEntriesRequest, AppendEntriesResponse]) error
func (UnimplementedMonsteraApiServer) HealthCheck ¶
func (UnimplementedMonsteraApiServer) HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
func (UnimplementedMonsteraApiServer) InstallSnapshot ¶
func (UnimplementedMonsteraApiServer) InstallSnapshot(grpc.ClientStreamingServer[InstallSnapshotRequest, InstallSnapshotResponse]) error
func (UnimplementedMonsteraApiServer) LeadershipTransfer ¶
func (UnimplementedMonsteraApiServer) LeadershipTransfer(context.Context, *LeadershipTransferRequest) (*LeadershipTransferResponse, error)
func (UnimplementedMonsteraApiServer) Read ¶
func (UnimplementedMonsteraApiServer) Read(context.Context, *ReadRequest) (*ReadResponse, error)
func (UnimplementedMonsteraApiServer) RequestVote ¶
func (UnimplementedMonsteraApiServer) RequestVote(context.Context, *RequestVoteRequest) (*RequestVoteResponse, error)
func (UnimplementedMonsteraApiServer) TimeoutNow ¶
func (UnimplementedMonsteraApiServer) TimeoutNow(context.Context, *TimeoutNowRequest) (*TimeoutNowResponse, error)
func (UnimplementedMonsteraApiServer) TriggerSnapshot ¶
func (UnimplementedMonsteraApiServer) TriggerSnapshot(context.Context, *TriggerSnapshotRequest) (*TriggerSnapshotResponse, error)
func (UnimplementedMonsteraApiServer) Update ¶
func (UnimplementedMonsteraApiServer) Update(context.Context, *UpdateRequest) (*UpdateResponse, error)
func (UnimplementedMonsteraApiServer) UpdateClusterConfig ¶
func (UnimplementedMonsteraApiServer) UpdateClusterConfig(context.Context, *UpdateClusterConfigRequest) (*UpdateClusterConfigResponse, error)
type UnsafeMonsteraApiServer ¶
type UnsafeMonsteraApiServer interface {
// contains filtered or unexported methods
}
UnsafeMonsteraApiServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MonsteraApiServer will result in compilation errors.
type UpdateClusterConfigRequest ¶
type UpdateClusterConfigRequest struct {
Config *ClusterConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
// contains filtered or unexported fields
}
func (*UpdateClusterConfigRequest) Descriptor
deprecated
func (*UpdateClusterConfigRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateClusterConfigRequest.ProtoReflect.Descriptor instead.
func (*UpdateClusterConfigRequest) GetConfig ¶
func (x *UpdateClusterConfigRequest) GetConfig() *ClusterConfig
func (*UpdateClusterConfigRequest) ProtoMessage ¶
func (*UpdateClusterConfigRequest) ProtoMessage()
func (*UpdateClusterConfigRequest) ProtoReflect ¶
func (x *UpdateClusterConfigRequest) ProtoReflect() protoreflect.Message
func (*UpdateClusterConfigRequest) Reset ¶
func (x *UpdateClusterConfigRequest) Reset()
func (*UpdateClusterConfigRequest) String ¶
func (x *UpdateClusterConfigRequest) String() string
type UpdateClusterConfigResponse ¶
type UpdateClusterConfigResponse struct {
// contains filtered or unexported fields
}
func (*UpdateClusterConfigResponse) Descriptor
deprecated
func (*UpdateClusterConfigResponse) Descriptor() ([]byte, []int)
Deprecated: Use UpdateClusterConfigResponse.ProtoReflect.Descriptor instead.
func (*UpdateClusterConfigResponse) ProtoMessage ¶
func (*UpdateClusterConfigResponse) ProtoMessage()
func (*UpdateClusterConfigResponse) ProtoReflect ¶
func (x *UpdateClusterConfigResponse) ProtoReflect() protoreflect.Message
func (*UpdateClusterConfigResponse) Reset ¶
func (x *UpdateClusterConfigResponse) Reset()
func (*UpdateClusterConfigResponse) String ¶
func (x *UpdateClusterConfigResponse) String() string
type UpdateRequest ¶
type UpdateRequest struct {
Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
ShardKey []byte `protobuf:"bytes,2,opt,name=shard_key,json=shardKey,proto3" json:"shard_key,omitempty"`
ApplicationName string `protobuf:"bytes,3,opt,name=application_name,json=applicationName,proto3" json:"application_name,omitempty"`
KeyspaceName string `protobuf:"bytes,4,opt,name=keyspace_name,json=keyspaceName,proto3" json:"keyspace_name,omitempty"`
ShardId string `protobuf:"bytes,5,opt,name=shard_id,json=shardId,proto3" json:"shard_id,omitempty"`
ReplicaId string `protobuf:"bytes,6,opt,name=replica_id,json=replicaId,proto3" json:"replica_id,omitempty"`
Hops int32 `protobuf:"varint,8,opt,name=hops,proto3" json:"hops,omitempty"`
// contains filtered or unexported fields
}
func (*UpdateRequest) Descriptor
deprecated
func (*UpdateRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead.
func (*UpdateRequest) GetApplicationName ¶
func (x *UpdateRequest) GetApplicationName() string
func (*UpdateRequest) GetHops ¶
func (x *UpdateRequest) GetHops() int32
func (*UpdateRequest) GetKeyspaceName ¶
func (x *UpdateRequest) GetKeyspaceName() string
func (*UpdateRequest) GetPayload ¶
func (x *UpdateRequest) GetPayload() []byte
func (*UpdateRequest) GetReplicaId ¶
func (x *UpdateRequest) GetReplicaId() string
func (*UpdateRequest) GetShardId ¶
func (x *UpdateRequest) GetShardId() string
func (*UpdateRequest) GetShardKey ¶
func (x *UpdateRequest) GetShardKey() []byte
func (*UpdateRequest) ProtoMessage ¶
func (*UpdateRequest) ProtoMessage()
func (*UpdateRequest) ProtoReflect ¶
func (x *UpdateRequest) ProtoReflect() protoreflect.Message
func (*UpdateRequest) Reset ¶
func (x *UpdateRequest) Reset()
func (*UpdateRequest) String ¶
func (x *UpdateRequest) String() string
type UpdateResponse ¶
type UpdateResponse struct {
Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
// contains filtered or unexported fields
}
func (*UpdateResponse) Descriptor
deprecated
func (*UpdateResponse) Descriptor() ([]byte, []int)
Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead.
func (*UpdateResponse) GetPayload ¶
func (x *UpdateResponse) GetPayload() []byte
func (*UpdateResponse) ProtoMessage ¶
func (*UpdateResponse) ProtoMessage()
func (*UpdateResponse) ProtoReflect ¶
func (x *UpdateResponse) ProtoReflect() protoreflect.Message
func (*UpdateResponse) Reset ¶
func (x *UpdateResponse) Reset()
func (*UpdateResponse) String ¶
func (x *UpdateResponse) String() string
