Documentation
¶
Index ¶
- Constants
- Variables
- func DescribeQuorum(ctx context.Context, table string) (q1 []*QuorumNode, q2 []*QuorumNode, err error)
- func IsOwned(key []byte) bool
- func IsOwnerlessKey(key []byte) bool
- func RegisterConsensusServer(s grpc.ServiceRegistrar, srv ConsensusServer)
- func WriteMutation(ctx context.Context, key []byte, mutation *RecordMutation) error
- type Acl
- type AclRole
- type AddPrincipal
- func (*AddPrincipal) Descriptor() ([]byte, []int)deprecated
- func (x *AddPrincipal) GetPrincipal() *Principal
- func (x *AddPrincipal) GetRole() AclRole
- func (*AddPrincipal) ProtoMessage()
- func (x *AddPrincipal) ProtoReflect() protoreflect.Message
- func (x *AddPrincipal) Reset()
- func (x *AddPrincipal) String() string
- type Ballot
- func (*Ballot) Descriptor() ([]byte, []int)deprecated
- func (x *Ballot) GetId() uint64
- func (x *Ballot) GetKey() []byte
- func (x *Ballot) GetNode() uint64
- func (b *Ballot) Less(other *Ballot) bool
- func (*Ballot) ProtoMessage()
- func (x *Ballot) ProtoReflect() protoreflect.Message
- func (x *Ballot) Reset()
- func (x *Ballot) String() string
- type BaseRepository
- func (r *BaseRepository[M, K]) CountPrefix(prefix Prefix) (int64, error)
- func (r *BaseRepository[M, K]) CreateKey(b []byte) K
- func (r *BaseRepository[M, K]) Delete(obj M, txn *kv.Transaction) (err error)
- func (r *BaseRepository[M, K]) DeleteByKey(k K) error
- func (r *BaseRepository[M, K]) GetByKey(k K, txn *kv.Transaction) (M, error)
- func (r *BaseRepository[M, K]) GetKeys(obj M) *StructuredKey
- func (r *BaseRepository[M, K]) PrefixScan(cursor []byte, write bool, prefix Prefix, c func(K, M, *kv.Transaction) error) error
- func (r *BaseRepository[M, K]) Put(obj M) error
- func (r *BaseRepository[M, K]) ScanIndex(prefix Prefix, write bool, ...) error
- func (r *BaseRepository[M, K]) Update(key K, cb func(M, kv.Transaction) (M, error)) (err error)
- type ClusterConfig
- func (*ClusterConfig) Descriptor() ([]byte, []int)deprecated
- func (x *ClusterConfig) GetClusterVersion() uint64
- func (x *ClusterConfig) GetFn() int64
- func (x *ClusterConfig) GetFz() int64
- func (x *ClusterConfig) GetNodes() []*Node
- func (*ClusterConfig) ProtoMessage()
- func (x *ClusterConfig) ProtoReflect() protoreflect.Message
- func (x *ClusterConfig) Reset()
- func (x *ClusterConfig) String() string
- type ConsensusClient
- type ConsensusServer
- type Consensus_DeReferenceClient
- type Consensus_DeReferenceServer
- type Consensus_FollowClient
- type Consensus_FollowServer
- type Consensus_ReplicateClient
- type Consensus_ReplicateServer
- type Consensus_RequestSlotsClient
- type Consensus_RequestSlotsServer
- type Data
- type DataKey
- type DataR
- type DataReference
- type DataRepository
- type Deletion
- type DereferenceRequest
- func (*DereferenceRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DereferenceRequest) GetReference() *DataReference
- func (*DereferenceRequest) ProtoMessage()
- func (x *DereferenceRequest) ProtoReflect() protoreflect.Message
- func (x *DereferenceRequest) Reset()
- func (x *DereferenceRequest) String() string
- type DereferenceResponse
- func (*DereferenceResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DereferenceResponse) GetData() *Data
- func (*DereferenceResponse) ProtoMessage()
- func (x *DereferenceResponse) ProtoReflect() protoreflect.Message
- func (x *DereferenceResponse) Reset()
- func (x *DereferenceResponse) String() string
- type GenericKey
- type HealthChecker
- type HealthStats
- type KVConsensusAdapter
- type Key
- type LatencyConfig
- func (c *LatencyConfig) ApplyPreset(preset LatencyPreset)
- func (c *LatencyConfig) Disable()
- func (c *LatencyConfig) Enable(matrix map[string]time.Duration)
- func (c *LatencyConfig) EnableDefault()
- func (c *LatencyConfig) GetLatency(fromRegion, toRegion string) time.Duration
- func (c *LatencyConfig) IsEnabled() bool
- func (c *LatencyConfig) SetJitter(percent int)
- func (c *LatencyConfig) SetLatency(fromRegion, toRegion string, latency time.Duration)
- type LatencyPreset
- type LatencyStats
- type ManagedNode
- type Node
- func (*Node) Descriptor() ([]byte, []int)deprecated
- func (x *Node) GetActive() bool
- func (x *Node) GetAddress() string
- func (x *Node) GetId() uint64
- func (x *Node) GetPort() int64
- func (x *Node) GetRegion() *Region
- func (x *Node) GetRtt() *durationpb.Duration
- func (*Node) ProtoMessage()
- func (x *Node) ProtoReflect() protoreflect.Message
- func (x *Node) Reset()
- func (x *Node) String() string
- type NodeConnectionManager
- func (ncm *NodeConnectionManager) AddNode(ctx context.Context, node *Node) error
- func (ncm *NodeConnectionManager) ExecuteOnNode(nodeID uint64, operation func(ConsensusClient) error) error
- func (ncm *NodeConnectionManager) GetActiveNodesByRegion(region string) []*ManagedNode
- func (ncm *NodeConnectionManager) GetAllActiveNodes() map[string][]*ManagedNode
- func (ncm *NodeConnectionManager) Shutdown()
- type NodeStatus
- type Noop
- type OwnershipState
- type OwnershipTracking
- func (*OwnershipTracking) Descriptor() ([]byte, []int)deprecated
- func (x *OwnershipTracking) GetMaxAcceptedSlot() uint64
- func (x *OwnershipTracking) GetMaxCommittedSlot() uint64
- func (x *OwnershipTracking) GetNextSlot() uint64
- func (x *OwnershipTracking) GetOwned() bool
- func (x *OwnershipTracking) GetPromised() *Ballot
- func (*OwnershipTracking) ProtoMessage()
- func (x *OwnershipTracking) ProtoReflect() protoreflect.Message
- func (x *OwnershipTracking) Reset()
- func (x *OwnershipTracking) String() string
- type PingRequest
- func (*PingRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PingRequest) GetSenderNodeId() uint64
- func (x *PingRequest) GetTimestamp() *timestamppb.Timestamp
- func (*PingRequest) ProtoMessage()
- func (x *PingRequest) ProtoReflect() protoreflect.Message
- func (x *PingRequest) Reset()
- func (x *PingRequest) String() string
- type PingResponse
- func (*PingResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PingResponse) GetResponderNodeId() uint64
- func (x *PingResponse) GetSuccess() bool
- func (x *PingResponse) GetTimestamp() *timestamppb.Timestamp
- func (*PingResponse) ProtoMessage()
- func (x *PingResponse) ProtoReflect() protoreflect.Message
- func (x *PingResponse) Reset()
- func (x *PingResponse) String() string
- type Prefix
- type PrefixScanRequest
- func (*PrefixScanRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PrefixScanRequest) GetPrefix() []byte
- func (x *PrefixScanRequest) GetSender() *Node
- func (*PrefixScanRequest) ProtoMessage()
- func (x *PrefixScanRequest) ProtoReflect() protoreflect.Message
- func (x *PrefixScanRequest) Reset()
- func (x *PrefixScanRequest) String() string
- type PrefixScanResponse
- func (*PrefixScanResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PrefixScanResponse) GetKeys() [][]byte
- func (x *PrefixScanResponse) GetSuccess() bool
- func (*PrefixScanResponse) ProtoMessage()
- func (x *PrefixScanResponse) ProtoReflect() protoreflect.Message
- func (x *PrefixScanResponse) Reset()
- func (x *PrefixScanResponse) String() string
- type Principal
- type Quorum
- type QuorumManager
- type QuorumNode
- func (q *QuorumNode) AcceptMigration(ctx context.Context, in *WriteMigrationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
- func (q *QuorumNode) Close()
- func (q *QuorumNode) DeReference(ctx context.Context, in *DereferenceRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[DereferenceResponse], error)
- func (q *QuorumNode) Follow(ctx context.Context, in *SlotRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RecordMutation], error)
- func (q *QuorumNode) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
- func (q *QuorumNode) PrefixScan(ctx context.Context, in *PrefixScanRequest, opts ...grpc.CallOption) (*PrefixScanResponse, error)
- func (q *QuorumNode) ReadRecord(ctx context.Context, in *ReadRecordRequest, opts ...grpc.CallOption) (*ReadRecordResponse, error)
- func (q *QuorumNode) Replicate(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[ReplicationRequest, ReplicationResponse], error)
- func (q *QuorumNode) RequestSlots(ctx context.Context, in *SlotRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RecordMutation], error)
- func (q *QuorumNode) StealTableOwnership(ctx context.Context, in *StealTableOwnershipRequest, opts ...grpc.CallOption) (*StealTableOwnershipResponse, error)
- func (q *QuorumNode) WriteMigration(ctx context.Context, in *WriteMigrationRequest, opts ...grpc.CallOption) (*WriteMigrationResponse, error)
- type ReadKeyRequest
- func (*ReadKeyRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ReadKeyRequest) GetKey() []byte
- func (x *ReadKeyRequest) GetSender() *Node
- func (x *ReadKeyRequest) GetWatermark() uint64
- func (*ReadKeyRequest) ProtoMessage()
- func (x *ReadKeyRequest) ProtoReflect() protoreflect.Message
- func (x *ReadKeyRequest) Reset()
- func (x *ReadKeyRequest) String() string
- type ReadKeyResponse
- func (*ReadKeyResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ReadKeyResponse) GetSuccess() bool
- func (x *ReadKeyResponse) GetValue() *DataReference
- func (*ReadKeyResponse) ProtoMessage()
- func (x *ReadKeyResponse) ProtoReflect() protoreflect.Message
- func (x *ReadKeyResponse) Reset()
- func (x *ReadKeyResponse) String() string
- type ReadRecordRequest
- type ReadRecordResponse
- func (*ReadRecordResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ReadRecordResponse) GetRecord() *Record
- func (x *ReadRecordResponse) GetSuccess() bool
- func (*ReadRecordResponse) ProtoMessage()
- func (x *ReadRecordResponse) ProtoReflect() protoreflect.Message
- func (x *ReadRecordResponse) Reset()
- func (x *ReadRecordResponse) String() string
- type Record
- func (*Record) Descriptor() ([]byte, []int)deprecated
- func (x *Record) GetAcl() *Acl
- func (x *Record) GetBaseRecord() *Record
- func (x *Record) GetData() *DataReference
- func (x *Record) GetMaxSlot() uint64
- func (*Record) ProtoMessage()
- func (x *Record) ProtoReflect() protoreflect.Message
- func (x *Record) Reset()
- func (x *Record) String() string
- type RecordMutation
- func (*RecordMutation) Descriptor() ([]byte, []int)deprecated
- func (x *RecordMutation) GetAddPrincipal() *AddPrincipal
- func (x *RecordMutation) GetBallot() *Ballot
- func (x *RecordMutation) GetCommitted() bool
- func (x *RecordMutation) GetCompaction() *Record
- func (x *RecordMutation) GetConfig() *ClusterConfig
- func (x *RecordMutation) GetMessage() isRecordMutation_Message
- func (x *RecordMutation) GetNoop() *Noop
- func (x *RecordMutation) GetRemovePrincipal() *RemovePrincipal
- func (x *RecordMutation) GetSlot() *Slot
- func (x *RecordMutation) GetTombstone() *Deletion
- func (x *RecordMutation) GetValueAddress() *DataReference
- func (*RecordMutation) ProtoMessage()
- func (x *RecordMutation) ProtoReflect() protoreflect.Message
- func (x *RecordMutation) Reset()
- func (x *RecordMutation) String() string
- type RecordMutation_AddPrincipal
- type RecordMutation_Compaction
- type RecordMutation_Config
- type RecordMutation_Noop
- type RecordMutation_RemovePrincipal
- type RecordMutation_Tombstone
- type RecordMutation_ValueAddress
- type Region
- type RegionName
- type RemovePrincipal
- func (*RemovePrincipal) Descriptor() ([]byte, []int)deprecated
- func (x *RemovePrincipal) GetPrincipal() *Principal
- func (x *RemovePrincipal) GetRole() AclRole
- func (*RemovePrincipal) ProtoMessage()
- func (x *RemovePrincipal) ProtoReflect() protoreflect.Message
- func (x *RemovePrincipal) Reset()
- func (x *RemovePrincipal) String() string
- type ReplicationRequest
- type ReplicationResponse
- func (*ReplicationResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ReplicationResponse) GetCommitted() bool
- func (*ReplicationResponse) ProtoMessage()
- func (x *ReplicationResponse) ProtoReflect() protoreflect.Message
- func (x *ReplicationResponse) Reset()
- func (x *ReplicationResponse) String() string
- type Repository
- type Server
- func (s *Server) AcceptMigration(ctx context.Context, req *WriteMigrationRequest) (*emptypb.Empty, error)
- func (s *Server) DeReference(req *DereferenceRequest, ...) error
- func (s *Server) Follow(req *SlotRequest, stream grpc.ServerStreamingServer[RecordMutation]) error
- func (s *Server) Ping(ctx context.Context, req *PingRequest) (*PingResponse, error)
- func (s *Server) PrefixScan(ctx context.Context, req *PrefixScanRequest) (*PrefixScanResponse, error)
- func (s *Server) ReadRecord(ctx context.Context, req *ReadRecordRequest) (*ReadRecordResponse, error)
- func (s *Server) Replicate(client grpc.ClientStreamingServer[ReplicationRequest, ReplicationResponse]) error
- func (s *Server) RequestSlots(req *SlotRequest, stream grpc.ServerStreamingServer[RecordMutation]) error
- func (s *Server) StealTableOwnership(ctx context.Context, req *StealTableOwnershipRequest) (*StealTableOwnershipResponse, error)
- func (s *Server) WriteMigration(ctx context.Context, req *WriteMigrationRequest) (*WriteMigrationResponse, error)
- type Slot
- type SlotRequest
- func (*SlotRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SlotRequest) GetEndSlot() uint64
- func (x *SlotRequest) GetKey() []byte
- func (x *SlotRequest) GetRequestedSlots() []uint64
- func (x *SlotRequest) GetStartSlot() uint64
- func (*SlotRequest) ProtoMessage()
- func (x *SlotRequest) ProtoReflect() protoreflect.Message
- func (x *SlotRequest) Reset()
- func (x *SlotRequest) String() string
- type StealTableOwnershipRequest
- func (*StealTableOwnershipRequest) Descriptor() ([]byte, []int)deprecated
- func (x *StealTableOwnershipRequest) GetBallot() *Ballot
- func (*StealTableOwnershipRequest) ProtoMessage()
- func (x *StealTableOwnershipRequest) ProtoReflect() protoreflect.Message
- func (x *StealTableOwnershipRequest) Reset()
- func (x *StealTableOwnershipRequest) String() string
- type StealTableOwnershipResponse
- func (*StealTableOwnershipResponse) Descriptor() ([]byte, []int)deprecated
- func (x *StealTableOwnershipResponse) GetHighestBallot() *Ballot
- func (x *StealTableOwnershipResponse) GetHighestSlot() *Slot
- func (x *StealTableOwnershipResponse) GetMissingRecords() []*RecordMutation
- func (x *StealTableOwnershipResponse) GetPromised() bool
- func (*StealTableOwnershipResponse) ProtoMessage()
- func (x *StealTableOwnershipResponse) ProtoReflect() protoreflect.Message
- func (x *StealTableOwnershipResponse) Reset()
- func (x *StealTableOwnershipResponse) String() string
- type StructuredKey
- type UnimplementedConsensusServer
- func (UnimplementedConsensusServer) AcceptMigration(context.Context, *WriteMigrationRequest) (*emptypb.Empty, error)
- func (UnimplementedConsensusServer) DeReference(*DereferenceRequest, grpc.ServerStreamingServer[DereferenceResponse]) error
- func (UnimplementedConsensusServer) Follow(*SlotRequest, grpc.ServerStreamingServer[RecordMutation]) error
- func (UnimplementedConsensusServer) Ping(context.Context, *PingRequest) (*PingResponse, error)
- func (UnimplementedConsensusServer) PrefixScan(context.Context, *PrefixScanRequest) (*PrefixScanResponse, error)
- func (UnimplementedConsensusServer) ReadRecord(context.Context, *ReadRecordRequest) (*ReadRecordResponse, error)
- func (UnimplementedConsensusServer) Replicate(grpc.ClientStreamingServer[ReplicationRequest, ReplicationResponse]) error
- func (UnimplementedConsensusServer) RequestSlots(*SlotRequest, grpc.ServerStreamingServer[RecordMutation]) error
- func (UnimplementedConsensusServer) StealTableOwnership(context.Context, *StealTableOwnershipRequest) (*StealTableOwnershipResponse, error)
- func (UnimplementedConsensusServer) WriteMigration(context.Context, *WriteMigrationRequest) (*WriteMigrationResponse, error)
- type UnsafeConsensusServer
- type WriteKeyRequest
- func (*WriteKeyRequest) Descriptor() ([]byte, []int)deprecated
- func (x *WriteKeyRequest) GetKey() []byte
- func (x *WriteKeyRequest) GetMutation() *RecordMutation
- func (x *WriteKeyRequest) GetSender() *Node
- func (*WriteKeyRequest) ProtoMessage()
- func (x *WriteKeyRequest) ProtoReflect() protoreflect.Message
- func (x *WriteKeyRequest) Reset()
- func (x *WriteKeyRequest) String() string
- type WriteKeyResponse
- type WriteMigrationRequest
- func (*WriteMigrationRequest) Descriptor() ([]byte, []int)deprecated
- func (x *WriteMigrationRequest) GetRecord() *RecordMutation
- func (*WriteMigrationRequest) ProtoMessage()
- func (x *WriteMigrationRequest) ProtoReflect() protoreflect.Message
- func (x *WriteMigrationRequest) Reset()
- func (x *WriteMigrationRequest) String() string
- type WriteMigrationResponse
- func (*WriteMigrationResponse) Descriptor() ([]byte, []int)deprecated
- func (x *WriteMigrationResponse) GetAccepted() bool
- func (*WriteMigrationResponse) ProtoMessage()
- func (x *WriteMigrationResponse) ProtoReflect() protoreflect.Message
- func (x *WriteMigrationResponse) Reset()
- func (x *WriteMigrationResponse) String() string
Constants ¶
const ( Consensus_StealTableOwnership_FullMethodName = "/atlas.consensus.Consensus/StealTableOwnership" Consensus_WriteMigration_FullMethodName = "/atlas.consensus.Consensus/WriteMigration" Consensus_AcceptMigration_FullMethodName = "/atlas.consensus.Consensus/AcceptMigration" Consensus_Replicate_FullMethodName = "/atlas.consensus.Consensus/Replicate" Consensus_DeReference_FullMethodName = "/atlas.consensus.Consensus/DeReference" Consensus_Ping_FullMethodName = "/atlas.consensus.Consensus/Ping" Consensus_PrefixScan_FullMethodName = "/atlas.consensus.Consensus/PrefixScan" Consensus_RequestSlots_FullMethodName = "/atlas.consensus.Consensus/RequestSlots" Consensus_Follow_FullMethodName = "/atlas.consensus.Consensus/Follow" Consensus_ReadRecord_FullMethodName = "/atlas.consensus.Consensus/ReadRecord" )
Variables ¶
var ( AclRole_name = map[int32]string{ 0: "OWNER", 1: "READER", 2: "WRITER", } AclRole_value = map[string]int32{ "OWNER": 0, "READER": 1, "WRITER": 2, } )
Enum value maps for AclRole.
var Consensus_ServiceDesc = grpc.ServiceDesc{ ServiceName: "atlas.consensus.Consensus", HandlerType: (*ConsensusServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "StealTableOwnership", Handler: _Consensus_StealTableOwnership_Handler, }, { MethodName: "WriteMigration", Handler: _Consensus_WriteMigration_Handler, }, { MethodName: "AcceptMigration", Handler: _Consensus_AcceptMigration_Handler, }, { MethodName: "Ping", Handler: _Consensus_Ping_Handler, }, { MethodName: "PrefixScan", Handler: _Consensus_PrefixScan_Handler, }, { MethodName: "ReadRecord", Handler: _Consensus_ReadRecord_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Replicate", Handler: _Consensus_Replicate_Handler, ClientStreams: true, }, { StreamName: "DeReference", Handler: _Consensus_DeReference_Handler, ServerStreams: true, }, { StreamName: "RequestSlots", Handler: _Consensus_RequestSlots_Handler, ServerStreams: true, }, { StreamName: "Follow", Handler: _Consensus_Follow_Handler, ServerStreams: true, }, }, Metadata: "consensus/consensus.proto", }
Consensus_ServiceDesc is the grpc.ServiceDesc for Consensus service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var DefaultLatencyMatrix = map[string]time.Duration{ "us-east-1:us-east-1": 1 * time.Millisecond, "us-west-2:us-west-2": 1 * time.Millisecond, "eu-west-1:eu-west-1": 1 * time.Millisecond, "ap-south-1:ap-south-1": 1 * time.Millisecond, "us-east-1:us-west-2": 65 * time.Millisecond, "us-west-2:us-east-1": 65 * time.Millisecond, "us-east-1:eu-west-1": 85 * time.Millisecond, "eu-west-1:us-east-1": 85 * time.Millisecond, "us-west-2:eu-west-1": 140 * time.Millisecond, "eu-west-1:us-west-2": 140 * time.Millisecond, "us-east-1:ap-south-1": 180 * time.Millisecond, "ap-south-1:us-east-1": 180 * time.Millisecond, "us-west-2:ap-south-1": 200 * time.Millisecond, "ap-south-1:us-west-2": 200 * time.Millisecond, "eu-west-1:ap-south-1": 130 * time.Millisecond, "ap-south-1:eu-west-1": 130 * time.Millisecond, }
DefaultLatencyMatrix provides realistic inter-region latencies based on real-world cloud provider measurements (AWS/GCP approximate values).
var ErrCannotChangeReplicationLevel = errors.New("cannot change replication level of a table")
var ErrTablePolicyViolation = errors.New("table policy violation")
var File_consensus_consensus_proto protoreflect.FileDescriptor
Functions ¶
func DescribeQuorum ¶ added in v0.1.0
func DescribeQuorum(ctx context.Context, table string) (q1 []*QuorumNode, q2 []*QuorumNode, err error)
DescribeQuorum computes and returns diagnostic information about the potential quorum for a given table, showing all known nodes regardless of their current health status. This is intended for diagnostic purposes only.
func IsOwnerlessKey ¶ added in v0.2.0
func RegisterConsensusServer ¶ added in v0.1.0
func RegisterConsensusServer(s grpc.ServiceRegistrar, srv ConsensusServer)
func WriteMutation ¶ added in v0.2.0
func WriteMutation(ctx context.Context, key []byte, mutation *RecordMutation) error
WriteMutation writes a mutation to the consensus log using the WPaxos protocol. It encapsulates the complete flow: - Phase 1 (if not owned): Steal ownership via Q1 broadcast quorum - Phase 2: Write to Q2 majority quorum - Phase 3: Commit to Q2 majority quorum
The mutation's Slot and Ballot fields are populated internally.
Types ¶
type Acl ¶ added in v0.2.0
type Acl struct {
Owners []*Principal `protobuf:"bytes,1,rep,name=owners,proto3" json:"owners,omitempty"`
Readers []*Principal `protobuf:"bytes,2,rep,name=readers,proto3" json:"readers,omitempty"`
Writers []*Principal `protobuf:"bytes,3,rep,name=writers,proto3" json:"writers,omitempty"`
// contains filtered or unexported fields
}
func (*Acl) Descriptor
deprecated
added in
v0.2.0
func (*Acl) GetReaders ¶ added in v0.2.0
func (*Acl) GetWriters ¶ added in v0.2.0
func (*Acl) ProtoMessage ¶ added in v0.2.0
func (*Acl) ProtoMessage()
func (*Acl) ProtoReflect ¶ added in v0.2.0
func (x *Acl) ProtoReflect() protoreflect.Message
type AclRole ¶ added in v0.2.0
type AclRole int32
Atomic ACL mutations - apply without read-modify-write
func (AclRole) Descriptor ¶ added in v0.2.0
func (AclRole) Descriptor() protoreflect.EnumDescriptor
func (AclRole) EnumDescriptor
deprecated
added in
v0.2.0
func (AclRole) Number ¶ added in v0.2.0
func (x AclRole) Number() protoreflect.EnumNumber
func (AclRole) Type ¶ added in v0.2.0
func (AclRole) Type() protoreflect.EnumType
type AddPrincipal ¶ added in v0.2.0
type AddPrincipal struct {
Role AclRole `protobuf:"varint,1,opt,name=role,proto3,enum=atlas.consensus.AclRole" json:"role,omitempty"`
Principal *Principal `protobuf:"bytes,2,opt,name=principal,proto3" json:"principal,omitempty"`
// contains filtered or unexported fields
}
func (*AddPrincipal) Descriptor
deprecated
added in
v0.2.0
func (*AddPrincipal) Descriptor() ([]byte, []int)
Deprecated: Use AddPrincipal.ProtoReflect.Descriptor instead.
func (*AddPrincipal) GetPrincipal ¶ added in v0.2.0
func (x *AddPrincipal) GetPrincipal() *Principal
func (*AddPrincipal) GetRole ¶ added in v0.2.0
func (x *AddPrincipal) GetRole() AclRole
func (*AddPrincipal) ProtoMessage ¶ added in v0.2.0
func (*AddPrincipal) ProtoMessage()
func (*AddPrincipal) ProtoReflect ¶ added in v0.2.0
func (x *AddPrincipal) ProtoReflect() protoreflect.Message
func (*AddPrincipal) Reset ¶ added in v0.2.0
func (x *AddPrincipal) Reset()
func (*AddPrincipal) String ¶ added in v0.2.0
func (x *AddPrincipal) String() string
type Ballot ¶ added in v0.2.0
type Ballot struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
Node uint64 `protobuf:"varint,3,opt,name=node,proto3" json:"node,omitempty"`
// contains filtered or unexported fields
}
func (*Ballot) Descriptor
deprecated
added in
v0.2.0
func (*Ballot) ProtoMessage ¶ added in v0.2.0
func (*Ballot) ProtoMessage()
func (*Ballot) ProtoReflect ¶ added in v0.2.0
func (x *Ballot) ProtoReflect() protoreflect.Message
type BaseRepository ¶ added in v0.2.0
func (*BaseRepository[M, K]) CountPrefix ¶ added in v0.2.0
func (r *BaseRepository[M, K]) CountPrefix(prefix Prefix) (int64, error)
func (*BaseRepository[M, K]) CreateKey ¶ added in v0.2.0
func (r *BaseRepository[M, K]) CreateKey(b []byte) K
func (*BaseRepository[M, K]) Delete ¶ added in v0.2.0
func (r *BaseRepository[M, K]) Delete(obj M, txn *kv.Transaction) (err error)
func (*BaseRepository[M, K]) DeleteByKey ¶ added in v0.2.0
func (r *BaseRepository[M, K]) DeleteByKey(k K) error
func (*BaseRepository[M, K]) GetByKey ¶ added in v0.2.0
func (r *BaseRepository[M, K]) GetByKey(k K, txn *kv.Transaction) (M, error)
func (*BaseRepository[M, K]) GetKeys ¶ added in v0.2.0
func (r *BaseRepository[M, K]) GetKeys(obj M) *StructuredKey
func (*BaseRepository[M, K]) PrefixScan ¶ added in v0.2.0
func (r *BaseRepository[M, K]) PrefixScan(cursor []byte, write bool, prefix Prefix, c func(K, M, *kv.Transaction) error) error
func (*BaseRepository[M, K]) Put ¶ added in v0.2.0
func (r *BaseRepository[M, K]) Put(obj M) error
func (*BaseRepository[M, K]) ScanIndex ¶ added in v0.2.0
func (r *BaseRepository[M, K]) ScanIndex(prefix Prefix, write bool, callback func(primaryKey []byte, txn *kv.Transaction) error) error
ScanIndex scans secondary index keys where values are primary keys, not full messages
func (*BaseRepository[M, K]) Update ¶ added in v0.2.0
func (r *BaseRepository[M, K]) Update(key K, cb func(M, kv.Transaction) (M, error)) (err error)
type ClusterConfig ¶ added in v0.2.0
type ClusterConfig struct {
ClusterVersion uint64 `protobuf:"varint,1,opt,name=clusterVersion,proto3" json:"clusterVersion,omitempty"`
Nodes []*Node `protobuf:"bytes,2,rep,name=nodes,proto3" json:"nodes,omitempty"`
Fn int64 `protobuf:"varint,3,opt,name=fn,proto3" json:"fn,omitempty"`
Fz int64 `protobuf:"varint,4,opt,name=fz,proto3" json:"fz,omitempty"`
// contains filtered or unexported fields
}
func (*ClusterConfig) Descriptor
deprecated
added in
v0.2.0
func (*ClusterConfig) Descriptor() ([]byte, []int)
Deprecated: Use ClusterConfig.ProtoReflect.Descriptor instead.
func (*ClusterConfig) GetClusterVersion ¶ added in v0.2.0
func (x *ClusterConfig) GetClusterVersion() uint64
func (*ClusterConfig) GetFn ¶ added in v0.2.0
func (x *ClusterConfig) GetFn() int64
func (*ClusterConfig) GetFz ¶ added in v0.2.0
func (x *ClusterConfig) GetFz() int64
func (*ClusterConfig) GetNodes ¶ added in v0.2.0
func (x *ClusterConfig) GetNodes() []*Node
func (*ClusterConfig) ProtoMessage ¶ added in v0.2.0
func (*ClusterConfig) ProtoMessage()
func (*ClusterConfig) ProtoReflect ¶ added in v0.2.0
func (x *ClusterConfig) ProtoReflect() protoreflect.Message
func (*ClusterConfig) Reset ¶ added in v0.2.0
func (x *ClusterConfig) Reset()
func (*ClusterConfig) String ¶ added in v0.2.0
func (x *ClusterConfig) String() string
type ConsensusClient ¶ added in v0.1.0
type ConsensusClient interface {
StealTableOwnership(ctx context.Context, in *StealTableOwnershipRequest, opts ...grpc.CallOption) (*StealTableOwnershipResponse, error)
WriteMigration(ctx context.Context, in *WriteMigrationRequest, opts ...grpc.CallOption) (*WriteMigrationResponse, error)
AcceptMigration(ctx context.Context, in *WriteMigrationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
Replicate(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[ReplicationRequest, ReplicationResponse], error)
DeReference(ctx context.Context, in *DereferenceRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[DereferenceResponse], error)
Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
PrefixScan(ctx context.Context, in *PrefixScanRequest, opts ...grpc.CallOption) (*PrefixScanResponse, error)
RequestSlots(ctx context.Context, in *SlotRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RecordMutation], error)
Follow(ctx context.Context, in *SlotRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RecordMutation], error)
ReadRecord(ctx context.Context, in *ReadRecordRequest, opts ...grpc.CallOption) (*ReadRecordResponse, error)
}
ConsensusClient is the client API for Consensus 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 NewConsensusClient ¶ added in v0.1.0
func NewConsensusClient(cc grpc.ClientConnInterface) ConsensusClient
func WrapWithLatency ¶ added in v0.2.0
func WrapWithLatency(client ConsensusClient, targetRegion string) ConsensusClient
WrapWithLatency wraps a ConsensusClient with latency injection.
type ConsensusServer ¶ added in v0.1.0
type ConsensusServer interface {
StealTableOwnership(context.Context, *StealTableOwnershipRequest) (*StealTableOwnershipResponse, error)
WriteMigration(context.Context, *WriteMigrationRequest) (*WriteMigrationResponse, error)
AcceptMigration(context.Context, *WriteMigrationRequest) (*emptypb.Empty, error)
Replicate(grpc.ClientStreamingServer[ReplicationRequest, ReplicationResponse]) error
DeReference(*DereferenceRequest, grpc.ServerStreamingServer[DereferenceResponse]) error
Ping(context.Context, *PingRequest) (*PingResponse, error)
PrefixScan(context.Context, *PrefixScanRequest) (*PrefixScanResponse, error)
RequestSlots(*SlotRequest, grpc.ServerStreamingServer[RecordMutation]) error
Follow(*SlotRequest, grpc.ServerStreamingServer[RecordMutation]) error
ReadRecord(context.Context, *ReadRecordRequest) (*ReadRecordResponse, error)
// contains filtered or unexported methods
}
ConsensusServer is the server API for Consensus service. All implementations must embed UnimplementedConsensusServer for forward compatibility.
type Consensus_DeReferenceClient ¶ added in v0.2.0
type Consensus_DeReferenceClient = grpc.ServerStreamingClient[DereferenceResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Consensus_DeReferenceServer ¶ added in v0.2.0
type Consensus_DeReferenceServer = grpc.ServerStreamingServer[DereferenceResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Consensus_FollowClient ¶ added in v0.2.0
type Consensus_FollowClient = grpc.ServerStreamingClient[RecordMutation]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Consensus_FollowServer ¶ added in v0.2.0
type Consensus_FollowServer = grpc.ServerStreamingServer[RecordMutation]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Consensus_ReplicateClient ¶ added in v0.2.0
type Consensus_ReplicateClient = grpc.ClientStreamingClient[ReplicationRequest, ReplicationResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Consensus_ReplicateServer ¶ added in v0.2.0
type Consensus_ReplicateServer = grpc.ClientStreamingServer[ReplicationRequest, ReplicationResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Consensus_RequestSlotsClient ¶ added in v0.2.0
type Consensus_RequestSlotsClient = grpc.ServerStreamingClient[RecordMutation]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Consensus_RequestSlotsServer ¶ added in v0.2.0
type Consensus_RequestSlotsServer = grpc.ServerStreamingServer[RecordMutation]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Data ¶ added in v0.2.0
type Data struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
Chunk uint64 `protobuf:"varint,3,opt,name=chunk,proto3" json:"chunk,omitempty"`
// contains filtered or unexported fields
}
func (*Data) Descriptor
deprecated
added in
v0.2.0
func (*Data) ProtoMessage ¶ added in v0.2.0
func (*Data) ProtoMessage()
func (*Data) ProtoReflect ¶ added in v0.2.0
func (x *Data) ProtoReflect() protoreflect.Message
type DataKey ¶ added in v0.2.0
type DataKey struct {
GenericKey
}
type DataR ¶ added in v0.2.0
type DataR struct {
BaseRepository[*Data, DataKey]
}
func (*DataR) GetKeys ¶ added in v0.2.0
func (d *DataR) GetKeys(record *Data) *StructuredKey
func (*DataR) GetPrefix ¶ added in v0.2.0
func (d *DataR) GetPrefix(reference *DataReference) Prefix
type DataReference ¶ added in v0.2.0
type DataReference struct {
Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
// contains filtered or unexported fields
}
func (*DataReference) Descriptor
deprecated
added in
v0.2.0
func (*DataReference) Descriptor() ([]byte, []int)
Deprecated: Use DataReference.ProtoReflect.Descriptor instead.
func (*DataReference) GetAddress ¶ added in v0.2.0
func (x *DataReference) GetAddress() []byte
func (*DataReference) ProtoMessage ¶ added in v0.2.0
func (*DataReference) ProtoMessage()
func (*DataReference) ProtoReflect ¶ added in v0.2.0
func (x *DataReference) ProtoReflect() protoreflect.Message
func (*DataReference) Reset ¶ added in v0.2.0
func (x *DataReference) Reset()
func (*DataReference) String ¶ added in v0.2.0
func (x *DataReference) String() string
type DataRepository ¶ added in v0.2.0
type DataRepository interface {
Repository[*Data, DataKey]
GetPrefix(reference *DataReference) Prefix
}
func NewDataRepository ¶ added in v0.2.0
func NewDataRepository(ctx context.Context) DataRepository
type Deletion ¶ added in v0.2.0
type Deletion struct {
// contains filtered or unexported fields
}
func (*Deletion) Descriptor
deprecated
added in
v0.2.0
func (*Deletion) ProtoMessage ¶ added in v0.2.0
func (*Deletion) ProtoMessage()
func (*Deletion) ProtoReflect ¶ added in v0.2.0
func (x *Deletion) ProtoReflect() protoreflect.Message
type DereferenceRequest ¶ added in v0.2.0
type DereferenceRequest struct {
Reference *DataReference `protobuf:"bytes,1,opt,name=reference,proto3" json:"reference,omitempty"`
// contains filtered or unexported fields
}
func (*DereferenceRequest) Descriptor
deprecated
added in
v0.2.0
func (*DereferenceRequest) Descriptor() ([]byte, []int)
Deprecated: Use DereferenceRequest.ProtoReflect.Descriptor instead.
func (*DereferenceRequest) GetReference ¶ added in v0.2.0
func (x *DereferenceRequest) GetReference() *DataReference
func (*DereferenceRequest) ProtoMessage ¶ added in v0.2.0
func (*DereferenceRequest) ProtoMessage()
func (*DereferenceRequest) ProtoReflect ¶ added in v0.2.0
func (x *DereferenceRequest) ProtoReflect() protoreflect.Message
func (*DereferenceRequest) Reset ¶ added in v0.2.0
func (x *DereferenceRequest) Reset()
func (*DereferenceRequest) String ¶ added in v0.2.0
func (x *DereferenceRequest) String() string
type DereferenceResponse ¶ added in v0.2.0
type DereferenceResponse struct {
Data *Data `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
// contains filtered or unexported fields
}
func (*DereferenceResponse) Descriptor
deprecated
added in
v0.2.0
func (*DereferenceResponse) Descriptor() ([]byte, []int)
Deprecated: Use DereferenceResponse.ProtoReflect.Descriptor instead.
func (*DereferenceResponse) GetData ¶ added in v0.2.0
func (x *DereferenceResponse) GetData() *Data
func (*DereferenceResponse) ProtoMessage ¶ added in v0.2.0
func (*DereferenceResponse) ProtoMessage()
func (*DereferenceResponse) ProtoReflect ¶ added in v0.2.0
func (x *DereferenceResponse) ProtoReflect() protoreflect.Message
func (*DereferenceResponse) Reset ¶ added in v0.2.0
func (x *DereferenceResponse) Reset()
func (*DereferenceResponse) String ¶ added in v0.2.0
func (x *DereferenceResponse) String() string
type GenericKey ¶ added in v0.2.0
type GenericKey struct {
// contains filtered or unexported fields
}
func (GenericKey) Prefix ¶ added in v0.2.0
func (k GenericKey) Prefix(size int) Prefix
func (GenericKey) Raw ¶ added in v0.2.0
func (k GenericKey) Raw() []byte
type HealthChecker ¶
type HealthChecker struct {
// contains filtered or unexported fields
}
HealthChecker monitors node health and maintains active node lists
func NewHealthChecker ¶
func NewHealthChecker(manager *NodeConnectionManager) *HealthChecker
func NewHealthCheckerForTesting ¶
func NewHealthCheckerForTesting(manager *NodeConnectionManager) *HealthChecker
NewHealthCheckerForTesting creates a health checker with no jitter for testing
func (*HealthChecker) GetHealthStats ¶
func (hc *HealthChecker) GetHealthStats() *HealthStats
func (*HealthChecker) Start ¶
func (hc *HealthChecker) Start(ctx context.Context)
Start begins the health checking routine
type HealthStats ¶
type HealthStats struct {
TotalNodes int64 `json:"total_nodes"`
ActiveNodes int64 `json:"active_nodes"`
FailedNodes int64 `json:"failed_nodes"`
RegionStats map[string]int64 `json:"region_stats"`
AverageRTT time.Duration `json:"average_rtt"`
LastCheckTime time.Time `json:"last_check_time"`
}
GetHealthStats returns health statistics for monitoring
type KVConsensusAdapter ¶
type KVConsensusAdapter struct {
// contains filtered or unexported fields
}
KVConsensusAdapter provides a clean interface for KV operations using the existing w-paxos consensus
func NewKVConsensusAdapter ¶
func NewKVConsensusAdapter(server *Server, kvStore kv.Store) *KVConsensusAdapter
NewKVConsensusAdapter creates a new KV consensus adapter
type LatencyConfig ¶ added in v0.2.0
type LatencyConfig struct {
// contains filtered or unexported fields
}
LatencyConfig defines inter-region latency for testing purposes. This is used by integration tests to simulate realistic network conditions.
func GetLatencyConfig ¶ added in v0.2.0
func GetLatencyConfig() *LatencyConfig
GetLatencyConfig returns the global latency configuration.
func (*LatencyConfig) ApplyPreset ¶ added in v0.2.0
func (c *LatencyConfig) ApplyPreset(preset LatencyPreset)
ApplyPreset applies a predefined latency configuration.
func (*LatencyConfig) Disable ¶ added in v0.2.0
func (c *LatencyConfig) Disable()
Disable turns off latency injection.
func (*LatencyConfig) Enable ¶ added in v0.2.0
func (c *LatencyConfig) Enable(matrix map[string]time.Duration)
Enable activates latency injection with the given matrix.
func (*LatencyConfig) EnableDefault ¶ added in v0.2.0
func (c *LatencyConfig) EnableDefault()
EnableDefault activates latency injection with default realistic values.
func (*LatencyConfig) GetLatency ¶ added in v0.2.0
func (c *LatencyConfig) GetLatency(fromRegion, toRegion string) time.Duration
GetLatency returns the one-way latency between two regions.
func (*LatencyConfig) IsEnabled ¶ added in v0.2.0
func (c *LatencyConfig) IsEnabled() bool
IsEnabled returns whether latency injection is active.
func (*LatencyConfig) SetJitter ¶ added in v0.2.0
func (c *LatencyConfig) SetJitter(percent int)
SetJitter sets the jitter percentage (0-100).
func (*LatencyConfig) SetLatency ¶ added in v0.2.0
func (c *LatencyConfig) SetLatency(fromRegion, toRegion string, latency time.Duration)
SetLatency sets custom latency between two regions.
type LatencyPreset ¶ added in v0.2.0
type LatencyPreset string
LatencyPreset defines common testing scenarios.
const ( // PresetLocal simulates local/same-datacenter deployment (1-2ms) PresetLocal LatencyPreset = "local" // PresetSingleContinent simulates nodes within one continent (~20-70ms) PresetSingleContinent LatencyPreset = "single-continent" // PresetGlobal simulates worldwide deployment (~50-200ms) PresetGlobal LatencyPreset = "global" // PresetHighLatency simulates extreme conditions (~200-500ms) PresetHighLatency LatencyPreset = "high-latency" )
type LatencyStats ¶ added in v0.2.0
type LatencyStats struct {
TotalCalls atomic.Int64
TotalLatencyNs atomic.Int64
MinLatencyNs atomic.Int64
MaxLatencyNs atomic.Int64
}
LatencyStats tracks latency injection statistics for benchmarking.
func GetLatencyStats ¶ added in v0.2.0
func GetLatencyStats() *LatencyStats
GetLatencyStats returns the global latency statistics.
func (*LatencyStats) AverageLatency ¶ added in v0.2.0
func (s *LatencyStats) AverageLatency() time.Duration
AverageLatency returns the average injected latency.
func (*LatencyStats) Reset ¶ added in v0.2.0
func (s *LatencyStats) Reset()
Reset clears all latency statistics.
type ManagedNode ¶
type ManagedNode struct {
*Node
// contains filtered or unexported fields
}
ManagedNode represents a node with its connection state
func (*ManagedNode) AddRTTMeasurement ¶
func (m *ManagedNode) AddRTTMeasurement(rtt time.Duration)
func (*ManagedNode) Close ¶
func (m *ManagedNode) Close()
func (*ManagedNode) GetAverageRTT ¶
func (m *ManagedNode) GetAverageRTT() time.Duration
func (*ManagedNode) GetFailures ¶
func (m *ManagedNode) GetFailures() int64
func (*ManagedNode) GetStatus ¶
func (m *ManagedNode) GetStatus() NodeStatus
func (*ManagedNode) UpdateStatus ¶
func (m *ManagedNode) UpdateStatus(status NodeStatus)
type Node ¶ added in v0.1.0
type Node struct {
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // The ID of the node
Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // The address of the node
Region *Region `protobuf:"bytes,3,opt,name=region,proto3" json:"region,omitempty"` // The region the node is in
Port int64 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"` // The port the node listens on
Active bool `protobuf:"varint,5,opt,name=active,proto3" json:"active,omitempty"` // Whether the node is active
Rtt *durationpb.Duration `protobuf:"bytes,6,opt,name=rtt,proto3" json:"rtt,omitempty"` // The round trip time to the node
// contains filtered or unexported fields
}
message MigrationVersion { int64 tableVersion = 1; // The version of the table int64 migrationVersion = 2; // The version of the migration int64 nodeId = 3; // The ID of the node string tableName = 4; // The name of the table }
message GossipMigration { Migration migrationRequest = 1; // The migration to be gossiped Table table = 2; // The table the migration is for MigrationVersion previousMigration = 3; // The previous migration int64 ttl = 4; // The time to live of the gossip Node sender = 5; // The node sending the gossip }
message JoinClusterResponse { bool success = 1; // Whether the operation was successful Table table = 2; // The current node table if the requested node is not the owner int64 nodeId = 3; // The ID of the newly joined node }
message SchemaMigration { repeated string commands = 1; // The commands to be executed }
message ACL { ACLData owners = 1; ACLData readers = 2; ACLData writers = 3; }
message DataReference { bytes key = 1; bytes checksum = 2; }
message Record { oneof data { RawData value = 1; DataReference ref = 3; } ACL accessControl = 2; }
message RawData { bytes data = 1; }
message SetChange { bytes key = 1; Record data = 2; }
message AclChange { bytes key = 1; oneof change { ACL addition = 2; ACL deletion = 3; } }
message DelChange { bytes key = 1; }
message KVChange { oneof operation { SetChange set = 1; DelChange del = 2; RawData data = 3; AclChange acl = 4; } }
message DataMigration { google.protobuf.Timestamp time = 3; oneof session { KVChange change = 2; } }
message NilMigration {}
message Migration { MigrationVersion version = 1; // The version of the migration oneof migration { SchemaMigration schema = 2; // The schema migration DataMigration data = 3; // The data migration NilMigration none = 4; // Represents a read } }
message WriteMigrationRequest { Node sender = 1; // The node sending the migration Migration migration = 2; // The migration to be written }
message WriteMigrationResponse { bool success = 1; // Whether the operation was successful Table table = 2; // The table if the operation was not successful }
enum ReplicationLevel { global = 0; // Replicate the table globally regional = 1; // Replicate the table within the region local = 2; // Replicate the table within the node }
enum TableType { table = 0; // The table is a regular table group = 1; // The table is a group meta table trigger = 2; // The table is a trigger view = 3; // The table is a view sharded = 4; // The table is sharded }
message Principal { string name = 1; // The name of the principal string value = 2; // The value of the principal }
message Shard { Table table = 1; // The table the shard belongs to Table shard = 2; // The shard table repeated Principal principals = 3; // The principals the shard is sharded by }
message Table { string name = 1; // The name of the table ReplicationLevel replicationLevel = 2; // The replication level of the table Node owner = 3; // The global owner of the table google.protobuf.Timestamp createdAt = 4; // The time the table was created int64 version = 5; // The version of the table repeated string allowedRegions = 6; // The regions the table data can be replicated to repeated string restrictedRegions = 7; // The regions the table data cannot be replicated to string group = 9; // The group the table belongs to TableType type = 10; // The type of the table repeated string shardPrincipals = 11; // The principals the table is sharded by }
message TableGroup { Table details = 1; // The details of the group repeated Table tables = 2; // The tables in the group }
message StealTableOwnershipFailure { Table table = 1; // The table that was not stolen }
message StealTableOwnershipSuccess { Table table = 1; // The table that was stolen repeated Migration missingMigrations = 2; // The missing migrations, if any }
enum StealReason { queryReason = 0; // The table was stolen due to a readonly writeReason = 1; // The table was stolen due to a write discoveryReason = 2; // We only care about this for discovery }
message StealTableOwnershipRequest { Node sender = 1; // The node sending the request StealReason reason = 4; // The reason the table was stolen Table table = 2; // The table to be stolen }
message StealTableOwnershipResponse { bool promised = 1; // Whether the operation was successful oneof response { StealTableOwnershipFailure failure = 2; // The table that was not stolen StealTableOwnershipSuccess success = 3; // The table that was stolen } }
func (*Node) Descriptor
deprecated
added in
v0.1.0
func (*Node) GetAddress ¶ added in v0.1.0
func (*Node) GetRtt ¶ added in v0.1.0
func (x *Node) GetRtt() *durationpb.Duration
func (*Node) ProtoMessage ¶ added in v0.1.0
func (*Node) ProtoMessage()
func (*Node) ProtoReflect ¶ added in v0.1.0
func (x *Node) ProtoReflect() protoreflect.Message
type NodeConnectionManager ¶
type NodeConnectionManager struct {
// contains filtered or unexported fields
}
NodeConnectionManager centralizes all node connection management
func GetNodeConnectionManager ¶
func GetNodeConnectionManager(ctx context.Context) *NodeConnectionManager
GetNodeConnectionManager returns the singleton NodeConnectionManager instance
func (*NodeConnectionManager) AddNode ¶
func (ncm *NodeConnectionManager) AddNode(ctx context.Context, node *Node) error
AddNode registers a new node and attempts connection
func (*NodeConnectionManager) ExecuteOnNode ¶
func (ncm *NodeConnectionManager) ExecuteOnNode(nodeID uint64, operation func(ConsensusClient) error) error
ExecuteOnNode executes a consensus operation on a specific node
func (*NodeConnectionManager) GetActiveNodesByRegion ¶
func (ncm *NodeConnectionManager) GetActiveNodesByRegion(region string) []*ManagedNode
GetActiveNodesByRegion returns currently reachable nodes in a region
func (*NodeConnectionManager) GetAllActiveNodes ¶
func (ncm *NodeConnectionManager) GetAllActiveNodes() map[string][]*ManagedNode
GetAllActiveNodes returns all currently reachable nodes
func (*NodeConnectionManager) Shutdown ¶
func (ncm *NodeConnectionManager) Shutdown()
Shutdown gracefully closes all connections and stops background processes
type NodeStatus ¶
type NodeStatus int
const ( NodeStatusUnknown NodeStatus = iota NodeStatusConnecting NodeStatusActive NodeStatusFailed NodeStatusRemoved )
type Noop ¶ added in v0.2.0
type Noop struct {
// contains filtered or unexported fields
}
func (*Noop) Descriptor
deprecated
added in
v0.2.0
func (*Noop) ProtoMessage ¶ added in v0.2.0
func (*Noop) ProtoMessage()
func (*Noop) ProtoReflect ¶ added in v0.2.0
func (x *Noop) ProtoReflect() protoreflect.Message
type OwnershipState ¶ added in v0.2.0
type OwnershipState struct {
// contains filtered or unexported fields
}
type OwnershipTracking ¶ added in v0.2.0
type OwnershipTracking struct {
Promised *Ballot `protobuf:"bytes,1,opt,name=promised,proto3" json:"promised,omitempty"` // highest ballot promised
Owned bool `protobuf:"varint,2,opt,name=owned,proto3" json:"owned,omitempty"` // am I the owner of this?
NextSlot uint64 `protobuf:"varint,3,opt,name=nextSlot,proto3" json:"nextSlot,omitempty"` // slot to assign next
MaxAcceptedSlot uint64 `protobuf:"varint,4,opt,name=maxAcceptedSlot,proto3" json:"maxAcceptedSlot,omitempty"` // highest slot with an accepted value
MaxCommittedSlot uint64 `protobuf:"varint,5,opt,name=maxCommittedSlot,proto3" json:"maxCommittedSlot,omitempty"` // highest slot marked committed
// contains filtered or unexported fields
}
func (*OwnershipTracking) Descriptor
deprecated
added in
v0.2.0
func (*OwnershipTracking) Descriptor() ([]byte, []int)
Deprecated: Use OwnershipTracking.ProtoReflect.Descriptor instead.
func (*OwnershipTracking) GetMaxAcceptedSlot ¶ added in v0.2.0
func (x *OwnershipTracking) GetMaxAcceptedSlot() uint64
func (*OwnershipTracking) GetMaxCommittedSlot ¶ added in v0.2.0
func (x *OwnershipTracking) GetMaxCommittedSlot() uint64
func (*OwnershipTracking) GetNextSlot ¶ added in v0.2.0
func (x *OwnershipTracking) GetNextSlot() uint64
func (*OwnershipTracking) GetOwned ¶ added in v0.2.0
func (x *OwnershipTracking) GetOwned() bool
func (*OwnershipTracking) GetPromised ¶ added in v0.2.0
func (x *OwnershipTracking) GetPromised() *Ballot
func (*OwnershipTracking) ProtoMessage ¶ added in v0.2.0
func (*OwnershipTracking) ProtoMessage()
func (*OwnershipTracking) ProtoReflect ¶ added in v0.2.0
func (x *OwnershipTracking) ProtoReflect() protoreflect.Message
func (*OwnershipTracking) Reset ¶ added in v0.2.0
func (x *OwnershipTracking) Reset()
func (*OwnershipTracking) String ¶ added in v0.2.0
func (x *OwnershipTracking) String() string
type PingRequest ¶ added in v0.1.0
type PingRequest struct {
SenderNodeId uint64 `protobuf:"varint,1,opt,name=sender_node_id,json=senderNodeId,proto3" json:"sender_node_id,omitempty"` // The ID of the node sending the ping
Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp of the ping
// contains filtered or unexported fields
}
Ping messages for health checks
func (*PingRequest) Descriptor
deprecated
added in
v0.1.0
func (*PingRequest) Descriptor() ([]byte, []int)
Deprecated: Use PingRequest.ProtoReflect.Descriptor instead.
func (*PingRequest) GetSenderNodeId ¶ added in v0.1.0
func (x *PingRequest) GetSenderNodeId() uint64
func (*PingRequest) GetTimestamp ¶ added in v0.1.0
func (x *PingRequest) GetTimestamp() *timestamppb.Timestamp
func (*PingRequest) ProtoMessage ¶ added in v0.1.0
func (*PingRequest) ProtoMessage()
func (*PingRequest) ProtoReflect ¶ added in v0.1.0
func (x *PingRequest) ProtoReflect() protoreflect.Message
func (*PingRequest) Reset ¶ added in v0.1.0
func (x *PingRequest) Reset()
func (*PingRequest) String ¶ added in v0.1.0
func (x *PingRequest) String() string
type PingResponse ¶ added in v0.1.0
type PingResponse struct {
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // Whether the ping was successful
ResponderNodeId uint64 `protobuf:"varint,2,opt,name=responder_node_id,json=responderNodeId,proto3" json:"responder_node_id,omitempty"` // The ID of the node responding
Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp of the response
// contains filtered or unexported fields
}
func (*PingResponse) Descriptor
deprecated
added in
v0.1.0
func (*PingResponse) Descriptor() ([]byte, []int)
Deprecated: Use PingResponse.ProtoReflect.Descriptor instead.
func (*PingResponse) GetResponderNodeId ¶ added in v0.1.0
func (x *PingResponse) GetResponderNodeId() uint64
func (*PingResponse) GetSuccess ¶ added in v0.1.0
func (x *PingResponse) GetSuccess() bool
func (*PingResponse) GetTimestamp ¶ added in v0.1.0
func (x *PingResponse) GetTimestamp() *timestamppb.Timestamp
func (*PingResponse) ProtoMessage ¶ added in v0.1.0
func (*PingResponse) ProtoMessage()
func (*PingResponse) ProtoReflect ¶ added in v0.1.0
func (x *PingResponse) ProtoReflect() protoreflect.Message
func (*PingResponse) Reset ¶ added in v0.1.0
func (x *PingResponse) Reset()
func (*PingResponse) String ¶ added in v0.1.0
func (x *PingResponse) String() string
type PrefixScanRequest ¶ added in v0.1.0
type PrefixScanRequest struct {
Sender *Node `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
Prefix []byte `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"`
// contains filtered or unexported fields
}
Remote prefix scan
func (*PrefixScanRequest) Descriptor
deprecated
added in
v0.1.0
func (*PrefixScanRequest) Descriptor() ([]byte, []int)
Deprecated: Use PrefixScanRequest.ProtoReflect.Descriptor instead.
func (*PrefixScanRequest) GetPrefix ¶ added in v0.2.0
func (x *PrefixScanRequest) GetPrefix() []byte
func (*PrefixScanRequest) GetSender ¶ added in v0.1.0
func (x *PrefixScanRequest) GetSender() *Node
func (*PrefixScanRequest) ProtoMessage ¶ added in v0.1.0
func (*PrefixScanRequest) ProtoMessage()
func (*PrefixScanRequest) ProtoReflect ¶ added in v0.1.0
func (x *PrefixScanRequest) ProtoReflect() protoreflect.Message
func (*PrefixScanRequest) Reset ¶ added in v0.1.0
func (x *PrefixScanRequest) Reset()
func (*PrefixScanRequest) String ¶ added in v0.1.0
func (x *PrefixScanRequest) String() string
type PrefixScanResponse ¶ added in v0.1.0
type PrefixScanResponse struct {
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
Keys [][]byte `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"`
// contains filtered or unexported fields
}
func (*PrefixScanResponse) Descriptor
deprecated
added in
v0.1.0
func (*PrefixScanResponse) Descriptor() ([]byte, []int)
Deprecated: Use PrefixScanResponse.ProtoReflect.Descriptor instead.
func (*PrefixScanResponse) GetKeys ¶ added in v0.1.0
func (x *PrefixScanResponse) GetKeys() [][]byte
func (*PrefixScanResponse) GetSuccess ¶ added in v0.1.0
func (x *PrefixScanResponse) GetSuccess() bool
func (*PrefixScanResponse) ProtoMessage ¶ added in v0.1.0
func (*PrefixScanResponse) ProtoMessage()
func (*PrefixScanResponse) ProtoReflect ¶ added in v0.1.0
func (x *PrefixScanResponse) ProtoReflect() protoreflect.Message
func (*PrefixScanResponse) Reset ¶ added in v0.1.0
func (x *PrefixScanResponse) Reset()
func (*PrefixScanResponse) String ¶ added in v0.1.0
func (x *PrefixScanResponse) String() string
type Principal ¶ added in v0.1.0
type Principal struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
// contains filtered or unexported fields
}
func (*Principal) Descriptor
deprecated
added in
v0.1.0
func (*Principal) ProtoMessage ¶ added in v0.1.0
func (*Principal) ProtoMessage()
func (*Principal) ProtoReflect ¶ added in v0.1.0
func (x *Principal) ProtoReflect() protoreflect.Message
type QuorumManager ¶
type QuorumManager interface {
GetQuorum(ctx context.Context, table string) (Quorum, error)
GetBroadcastQuorum(ctx context.Context, table []byte) (Quorum, error)
AddNode(ctx context.Context, node *Node) error
RemoveNode(nodeID uint64) error
Send(node *Node, do func(quorumNode *QuorumNode) (any, error)) (any, error)
}
func GetDefaultQuorumManager ¶
func GetDefaultQuorumManager(ctx context.Context) QuorumManager
type QuorumNode ¶
type QuorumNode struct {
*Node
// contains filtered or unexported fields
}
func (*QuorumNode) AcceptMigration ¶
func (q *QuorumNode) AcceptMigration(ctx context.Context, in *WriteMigrationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
func (*QuorumNode) Close ¶
func (q *QuorumNode) Close()
func (*QuorumNode) DeReference ¶ added in v0.2.0
func (q *QuorumNode) DeReference(ctx context.Context, in *DereferenceRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[DereferenceResponse], error)
func (*QuorumNode) Follow ¶ added in v0.2.0
func (q *QuorumNode) Follow(ctx context.Context, in *SlotRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RecordMutation], error)
func (*QuorumNode) Ping ¶
func (q *QuorumNode) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
func (*QuorumNode) PrefixScan ¶ added in v0.1.0
func (q *QuorumNode) PrefixScan(ctx context.Context, in *PrefixScanRequest, opts ...grpc.CallOption) (*PrefixScanResponse, error)
func (*QuorumNode) ReadRecord ¶ added in v0.2.0
func (q *QuorumNode) ReadRecord(ctx context.Context, in *ReadRecordRequest, opts ...grpc.CallOption) (*ReadRecordResponse, error)
func (*QuorumNode) Replicate ¶ added in v0.2.0
func (q *QuorumNode) Replicate(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[ReplicationRequest, ReplicationResponse], error)
func (*QuorumNode) RequestSlots ¶ added in v0.2.0
func (q *QuorumNode) RequestSlots(ctx context.Context, in *SlotRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RecordMutation], error)
func (*QuorumNode) StealTableOwnership ¶
func (q *QuorumNode) StealTableOwnership(ctx context.Context, in *StealTableOwnershipRequest, opts ...grpc.CallOption) (*StealTableOwnershipResponse, error)
func (*QuorumNode) WriteMigration ¶
func (q *QuorumNode) WriteMigration(ctx context.Context, in *WriteMigrationRequest, opts ...grpc.CallOption) (*WriteMigrationResponse, error)
type ReadKeyRequest ¶ added in v0.1.0
type ReadKeyRequest struct {
Sender *Node `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` // The node requesting the read
Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // The key to read
Watermark uint64 `protobuf:"varint,3,opt,name=watermark,proto3" json:"watermark,omitempty"` // The watermark for read consistency
// contains filtered or unexported fields
}
Remote read messages for leader-based reads
func (*ReadKeyRequest) Descriptor
deprecated
added in
v0.1.0
func (*ReadKeyRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReadKeyRequest.ProtoReflect.Descriptor instead.
func (*ReadKeyRequest) GetKey ¶ added in v0.1.0
func (x *ReadKeyRequest) GetKey() []byte
func (*ReadKeyRequest) GetSender ¶ added in v0.1.0
func (x *ReadKeyRequest) GetSender() *Node
func (*ReadKeyRequest) GetWatermark ¶ added in v0.2.0
func (x *ReadKeyRequest) GetWatermark() uint64
func (*ReadKeyRequest) ProtoMessage ¶ added in v0.1.0
func (*ReadKeyRequest) ProtoMessage()
func (*ReadKeyRequest) ProtoReflect ¶ added in v0.1.0
func (x *ReadKeyRequest) ProtoReflect() protoreflect.Message
func (*ReadKeyRequest) Reset ¶ added in v0.1.0
func (x *ReadKeyRequest) Reset()
func (*ReadKeyRequest) String ¶ added in v0.1.0
func (x *ReadKeyRequest) String() string
type ReadKeyResponse ¶ added in v0.1.0
type ReadKeyResponse struct {
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // Whether the read was successful
Value *DataReference `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // The value if found, empty if not found
// contains filtered or unexported fields
}
func (*ReadKeyResponse) Descriptor
deprecated
added in
v0.1.0
func (*ReadKeyResponse) Descriptor() ([]byte, []int)
Deprecated: Use ReadKeyResponse.ProtoReflect.Descriptor instead.
func (*ReadKeyResponse) GetSuccess ¶ added in v0.1.0
func (x *ReadKeyResponse) GetSuccess() bool
func (*ReadKeyResponse) GetValue ¶ added in v0.1.0
func (x *ReadKeyResponse) GetValue() *DataReference
func (*ReadKeyResponse) ProtoMessage ¶ added in v0.1.0
func (*ReadKeyResponse) ProtoMessage()
func (*ReadKeyResponse) ProtoReflect ¶ added in v0.1.0
func (x *ReadKeyResponse) ProtoReflect() protoreflect.Message
func (*ReadKeyResponse) Reset ¶ added in v0.1.0
func (x *ReadKeyResponse) Reset()
func (*ReadKeyResponse) String ¶ added in v0.1.0
func (x *ReadKeyResponse) String() string
type ReadRecordRequest ¶ added in v0.2.0
type ReadRecordRequest struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // The key to read
// contains filtered or unexported fields
}
Read Record from leader (returns full Record with ACL, DataReference, etc.)
func (*ReadRecordRequest) Descriptor
deprecated
added in
v0.2.0
func (*ReadRecordRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReadRecordRequest.ProtoReflect.Descriptor instead.
func (*ReadRecordRequest) GetKey ¶ added in v0.2.0
func (x *ReadRecordRequest) GetKey() []byte
func (*ReadRecordRequest) ProtoMessage ¶ added in v0.2.0
func (*ReadRecordRequest) ProtoMessage()
func (*ReadRecordRequest) ProtoReflect ¶ added in v0.2.0
func (x *ReadRecordRequest) ProtoReflect() protoreflect.Message
func (*ReadRecordRequest) Reset ¶ added in v0.2.0
func (x *ReadRecordRequest) Reset()
func (*ReadRecordRequest) String ¶ added in v0.2.0
func (x *ReadRecordRequest) String() string
type ReadRecordResponse ¶ added in v0.2.0
type ReadRecordResponse struct {
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // Whether the read was successful
Record *Record `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"` // The full Record if found
// contains filtered or unexported fields
}
func (*ReadRecordResponse) Descriptor
deprecated
added in
v0.2.0
func (*ReadRecordResponse) Descriptor() ([]byte, []int)
Deprecated: Use ReadRecordResponse.ProtoReflect.Descriptor instead.
func (*ReadRecordResponse) GetRecord ¶ added in v0.2.0
func (x *ReadRecordResponse) GetRecord() *Record
func (*ReadRecordResponse) GetSuccess ¶ added in v0.2.0
func (x *ReadRecordResponse) GetSuccess() bool
func (*ReadRecordResponse) ProtoMessage ¶ added in v0.2.0
func (*ReadRecordResponse) ProtoMessage()
func (*ReadRecordResponse) ProtoReflect ¶ added in v0.2.0
func (x *ReadRecordResponse) ProtoReflect() protoreflect.Message
func (*ReadRecordResponse) Reset ¶ added in v0.2.0
func (x *ReadRecordResponse) Reset()
func (*ReadRecordResponse) String ¶ added in v0.2.0
func (x *ReadRecordResponse) String() string
type Record ¶ added in v0.1.0
type Record struct {
MaxSlot uint64 `protobuf:"varint,4,opt,name=maxSlot,proto3" json:"maxSlot,omitempty"`
Acl *Acl `protobuf:"bytes,2,opt,name=acl,proto3" json:"acl,omitempty"`
Data *DataReference `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
BaseRecord *Record `protobuf:"bytes,5,opt,name=baseRecord,proto3" json:"baseRecord,omitempty"`
// contains filtered or unexported fields
}
func ReadKey ¶ added in v0.2.0
ReadKey reads a key from the consensus layer. It returns the current Record for the key, which contains: - DataReference (CAS address to the actual value) - ACL information
Without watermarks, reads must go through the current owner/leader. This function: 1. Checks if we own the key (fast path - read locally) 2. If not, performs Phase-1 discovery with <0,0> ballot to find leader 3. If we're the leader, read locally 4. Otherwise, steals ownership and reads (ensures linearizability)
func (*Record) Descriptor
deprecated
added in
v0.1.0
func (*Record) GetBaseRecord ¶ added in v0.2.0
func (*Record) GetData ¶ added in v0.2.0
func (x *Record) GetData() *DataReference
func (*Record) GetMaxSlot ¶ added in v0.2.0
func (*Record) ProtoMessage ¶ added in v0.1.0
func (*Record) ProtoMessage()
func (*Record) ProtoReflect ¶ added in v0.1.0
func (x *Record) ProtoReflect() protoreflect.Message
type RecordMutation ¶ added in v0.2.0
type RecordMutation struct {
Slot *Slot `protobuf:"bytes,1,opt,name=slot,proto3" json:"slot,omitempty"`
Ballot *Ballot `protobuf:"bytes,8,opt,name=ballot,proto3" json:"ballot,omitempty"`
// Types that are valid to be assigned to Message:
//
// *RecordMutation_ValueAddress
// *RecordMutation_Tombstone
// *RecordMutation_Compaction
// *RecordMutation_Noop
// *RecordMutation_Config
// *RecordMutation_AddPrincipal
// *RecordMutation_RemovePrincipal
Message isRecordMutation_Message `protobuf_oneof:"message"`
Committed bool `protobuf:"varint,7,opt,name=committed,proto3" json:"committed,omitempty"`
// contains filtered or unexported fields
}
func (*RecordMutation) Descriptor
deprecated
added in
v0.2.0
func (*RecordMutation) Descriptor() ([]byte, []int)
Deprecated: Use RecordMutation.ProtoReflect.Descriptor instead.
func (*RecordMutation) GetAddPrincipal ¶ added in v0.2.0
func (x *RecordMutation) GetAddPrincipal() *AddPrincipal
func (*RecordMutation) GetBallot ¶ added in v0.2.0
func (x *RecordMutation) GetBallot() *Ballot
func (*RecordMutation) GetCommitted ¶ added in v0.2.0
func (x *RecordMutation) GetCommitted() bool
func (*RecordMutation) GetCompaction ¶ added in v0.2.0
func (x *RecordMutation) GetCompaction() *Record
func (*RecordMutation) GetConfig ¶ added in v0.2.0
func (x *RecordMutation) GetConfig() *ClusterConfig
func (*RecordMutation) GetMessage ¶ added in v0.2.0
func (x *RecordMutation) GetMessage() isRecordMutation_Message
func (*RecordMutation) GetNoop ¶ added in v0.2.0
func (x *RecordMutation) GetNoop() *Noop
func (*RecordMutation) GetRemovePrincipal ¶ added in v0.2.0
func (x *RecordMutation) GetRemovePrincipal() *RemovePrincipal
func (*RecordMutation) GetSlot ¶ added in v0.2.0
func (x *RecordMutation) GetSlot() *Slot
func (*RecordMutation) GetTombstone ¶ added in v0.2.0
func (x *RecordMutation) GetTombstone() *Deletion
func (*RecordMutation) GetValueAddress ¶ added in v0.2.0
func (x *RecordMutation) GetValueAddress() *DataReference
func (*RecordMutation) ProtoMessage ¶ added in v0.2.0
func (*RecordMutation) ProtoMessage()
func (*RecordMutation) ProtoReflect ¶ added in v0.2.0
func (x *RecordMutation) ProtoReflect() protoreflect.Message
func (*RecordMutation) Reset ¶ added in v0.2.0
func (x *RecordMutation) Reset()
func (*RecordMutation) String ¶ added in v0.2.0
func (x *RecordMutation) String() string
type RecordMutation_AddPrincipal ¶ added in v0.2.0
type RecordMutation_AddPrincipal struct {
AddPrincipal *AddPrincipal `protobuf:"bytes,10,opt,name=addPrincipal,proto3,oneof"`
}
type RecordMutation_Compaction ¶ added in v0.2.0
type RecordMutation_Compaction struct {
Compaction *Record `protobuf:"bytes,5,opt,name=compaction,proto3,oneof"`
}
type RecordMutation_Config ¶ added in v0.2.0
type RecordMutation_Config struct {
Config *ClusterConfig `protobuf:"bytes,9,opt,name=config,proto3,oneof"`
}
type RecordMutation_Noop ¶ added in v0.2.0
type RecordMutation_Noop struct {
Noop *Noop `protobuf:"bytes,6,opt,name=noop,proto3,oneof"`
}
type RecordMutation_RemovePrincipal ¶ added in v0.2.0
type RecordMutation_RemovePrincipal struct {
RemovePrincipal *RemovePrincipal `protobuf:"bytes,11,opt,name=removePrincipal,proto3,oneof"`
}
type RecordMutation_Tombstone ¶ added in v0.2.0
type RecordMutation_Tombstone struct {
Tombstone *Deletion `protobuf:"bytes,3,opt,name=tombstone,proto3,oneof"`
}
type RecordMutation_ValueAddress ¶ added in v0.2.0
type RecordMutation_ValueAddress struct {
ValueAddress *DataReference `protobuf:"bytes,2,opt,name=valueAddress,proto3,oneof"`
}
type Region ¶ added in v0.1.0
type Region struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The region name
// contains filtered or unexported fields
}
func (*Region) Descriptor
deprecated
added in
v0.1.0
func (*Region) ProtoMessage ¶ added in v0.1.0
func (*Region) ProtoMessage()
func (*Region) ProtoReflect ¶ added in v0.1.0
func (x *Region) ProtoReflect() protoreflect.Message
type RegionName ¶
type RegionName string
type RemovePrincipal ¶ added in v0.2.0
type RemovePrincipal struct {
Role AclRole `protobuf:"varint,1,opt,name=role,proto3,enum=atlas.consensus.AclRole" json:"role,omitempty"`
Principal *Principal `protobuf:"bytes,2,opt,name=principal,proto3" json:"principal,omitempty"`
// contains filtered or unexported fields
}
func (*RemovePrincipal) Descriptor
deprecated
added in
v0.2.0
func (*RemovePrincipal) Descriptor() ([]byte, []int)
Deprecated: Use RemovePrincipal.ProtoReflect.Descriptor instead.
func (*RemovePrincipal) GetPrincipal ¶ added in v0.2.0
func (x *RemovePrincipal) GetPrincipal() *Principal
func (*RemovePrincipal) GetRole ¶ added in v0.2.0
func (x *RemovePrincipal) GetRole() AclRole
func (*RemovePrincipal) ProtoMessage ¶ added in v0.2.0
func (*RemovePrincipal) ProtoMessage()
func (*RemovePrincipal) ProtoReflect ¶ added in v0.2.0
func (x *RemovePrincipal) ProtoReflect() protoreflect.Message
func (*RemovePrincipal) Reset ¶ added in v0.2.0
func (x *RemovePrincipal) Reset()
func (*RemovePrincipal) String ¶ added in v0.2.0
func (x *RemovePrincipal) String() string
type ReplicationRequest ¶ added in v0.2.0
type ReplicationRequest struct {
Data *Data `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
// contains filtered or unexported fields
}
func (*ReplicationRequest) Descriptor
deprecated
added in
v0.2.0
func (*ReplicationRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReplicationRequest.ProtoReflect.Descriptor instead.
func (*ReplicationRequest) GetData ¶ added in v0.2.0
func (x *ReplicationRequest) GetData() *Data
func (*ReplicationRequest) ProtoMessage ¶ added in v0.2.0
func (*ReplicationRequest) ProtoMessage()
func (*ReplicationRequest) ProtoReflect ¶ added in v0.2.0
func (x *ReplicationRequest) ProtoReflect() protoreflect.Message
func (*ReplicationRequest) Reset ¶ added in v0.2.0
func (x *ReplicationRequest) Reset()
func (*ReplicationRequest) String ¶ added in v0.2.0
func (x *ReplicationRequest) String() string
type ReplicationResponse ¶ added in v0.2.0
type ReplicationResponse struct {
Committed bool `protobuf:"varint,1,opt,name=committed,proto3" json:"committed,omitempty"`
// contains filtered or unexported fields
}
func (*ReplicationResponse) Descriptor
deprecated
added in
v0.2.0
func (*ReplicationResponse) Descriptor() ([]byte, []int)
Deprecated: Use ReplicationResponse.ProtoReflect.Descriptor instead.
func (*ReplicationResponse) GetCommitted ¶ added in v0.2.0
func (x *ReplicationResponse) GetCommitted() bool
func (*ReplicationResponse) ProtoMessage ¶ added in v0.2.0
func (*ReplicationResponse) ProtoMessage()
func (*ReplicationResponse) ProtoReflect ¶ added in v0.2.0
func (x *ReplicationResponse) ProtoReflect() protoreflect.Message
func (*ReplicationResponse) Reset ¶ added in v0.2.0
func (x *ReplicationResponse) Reset()
func (*ReplicationResponse) String ¶ added in v0.2.0
func (x *ReplicationResponse) String() string
type Repository ¶ added in v0.2.0
type Repository[M proto.Message, K Key] interface { GetByKey(k K, txn *kv.Transaction) (M, error) GetKeys(obj M) *StructuredKey CreateKey(b []byte) K Put(obj M) error Delete(obj M, txn *kv.Transaction) error DeleteByKey(k K) error PrefixScan(cursor []byte, write bool, prefix Prefix, c func(K, M, *kv.Transaction) error) error ScanIndex(prefix Prefix, write bool, callback func(primaryKey []byte, txn *kv.Transaction) error) error }
type Server ¶
type Server struct {
UnimplementedConsensusServer
}
func (*Server) AcceptMigration ¶
func (*Server) DeReference ¶ added in v0.2.0
func (s *Server) DeReference(req *DereferenceRequest, client grpc.ServerStreamingServer[DereferenceResponse]) error
func (*Server) Follow ¶ added in v0.2.0
func (s *Server) Follow(req *SlotRequest, stream grpc.ServerStreamingServer[RecordMutation]) error
func (*Server) Ping ¶
func (s *Server) Ping(ctx context.Context, req *PingRequest) (*PingResponse, error)
Ping implements a simple health check endpoint
func (*Server) PrefixScan ¶ added in v0.1.0
func (s *Server) PrefixScan(ctx context.Context, req *PrefixScanRequest) (*PrefixScanResponse, error)
func (*Server) ReadRecord ¶ added in v0.2.0
func (s *Server) ReadRecord(ctx context.Context, req *ReadRecordRequest) (*ReadRecordResponse, error)
func (*Server) Replicate ¶ added in v0.2.0
func (s *Server) Replicate(client grpc.ClientStreamingServer[ReplicationRequest, ReplicationResponse]) error
func (*Server) RequestSlots ¶ added in v0.2.0
func (s *Server) RequestSlots(req *SlotRequest, stream grpc.ServerStreamingServer[RecordMutation]) error
func (*Server) StealTableOwnership ¶
func (s *Server) StealTableOwnership(ctx context.Context, req *StealTableOwnershipRequest) (*StealTableOwnershipResponse, error)
func (*Server) WriteMigration ¶
func (s *Server) WriteMigration(ctx context.Context, req *WriteMigrationRequest) (*WriteMigrationResponse, error)
type Slot ¶ added in v0.2.0
type Slot struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
Node uint64 `protobuf:"varint,3,opt,name=node,proto3" json:"node,omitempty"`
// contains filtered or unexported fields
}
func (*Slot) Descriptor
deprecated
added in
v0.2.0
func (*Slot) ProtoMessage ¶ added in v0.2.0
func (*Slot) ProtoMessage()
func (*Slot) ProtoReflect ¶ added in v0.2.0
func (x *Slot) ProtoReflect() protoreflect.Message
type SlotRequest ¶ added in v0.2.0
type SlotRequest struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
StartSlot uint64 `protobuf:"varint,2,opt,name=startSlot,proto3" json:"startSlot,omitempty"`
EndSlot uint64 `protobuf:"varint,3,opt,name=endSlot,proto3" json:"endSlot,omitempty"`
RequestedSlots []uint64 `protobuf:"varint,4,rep,packed,name=requestedSlots,proto3" json:"requestedSlots,omitempty"`
// contains filtered or unexported fields
}
func (*SlotRequest) Descriptor
deprecated
added in
v0.2.0
func (*SlotRequest) Descriptor() ([]byte, []int)
Deprecated: Use SlotRequest.ProtoReflect.Descriptor instead.
func (*SlotRequest) GetEndSlot ¶ added in v0.2.0
func (x *SlotRequest) GetEndSlot() uint64
func (*SlotRequest) GetKey ¶ added in v0.2.0
func (x *SlotRequest) GetKey() []byte
func (*SlotRequest) GetRequestedSlots ¶ added in v0.2.0
func (x *SlotRequest) GetRequestedSlots() []uint64
func (*SlotRequest) GetStartSlot ¶ added in v0.2.0
func (x *SlotRequest) GetStartSlot() uint64
func (*SlotRequest) ProtoMessage ¶ added in v0.2.0
func (*SlotRequest) ProtoMessage()
func (*SlotRequest) ProtoReflect ¶ added in v0.2.0
func (x *SlotRequest) ProtoReflect() protoreflect.Message
func (*SlotRequest) Reset ¶ added in v0.2.0
func (x *SlotRequest) Reset()
func (*SlotRequest) String ¶ added in v0.2.0
func (x *SlotRequest) String() string
type StealTableOwnershipRequest ¶ added in v0.1.0
type StealTableOwnershipRequest struct {
Ballot *Ballot `protobuf:"bytes,1,opt,name=ballot,proto3" json:"ballot,omitempty"`
// contains filtered or unexported fields
}
ownership messages
func (*StealTableOwnershipRequest) Descriptor
deprecated
added in
v0.1.0
func (*StealTableOwnershipRequest) Descriptor() ([]byte, []int)
Deprecated: Use StealTableOwnershipRequest.ProtoReflect.Descriptor instead.
func (*StealTableOwnershipRequest) GetBallot ¶ added in v0.2.0
func (x *StealTableOwnershipRequest) GetBallot() *Ballot
func (*StealTableOwnershipRequest) ProtoMessage ¶ added in v0.1.0
func (*StealTableOwnershipRequest) ProtoMessage()
func (*StealTableOwnershipRequest) ProtoReflect ¶ added in v0.1.0
func (x *StealTableOwnershipRequest) ProtoReflect() protoreflect.Message
func (*StealTableOwnershipRequest) Reset ¶ added in v0.1.0
func (x *StealTableOwnershipRequest) Reset()
func (*StealTableOwnershipRequest) String ¶ added in v0.1.0
func (x *StealTableOwnershipRequest) String() string
type StealTableOwnershipResponse ¶ added in v0.1.0
type StealTableOwnershipResponse struct {
Promised bool `protobuf:"varint,1,opt,name=promised,proto3" json:"promised,omitempty"`
MissingRecords []*RecordMutation `protobuf:"bytes,2,rep,name=missingRecords,proto3" json:"missingRecords,omitempty"`
HighestBallot *Ballot `protobuf:"bytes,3,opt,name=highestBallot,proto3" json:"highestBallot,omitempty"`
HighestSlot *Slot `protobuf:"bytes,4,opt,name=highestSlot,proto3" json:"highestSlot,omitempty"`
// contains filtered or unexported fields
}
func (*StealTableOwnershipResponse) Descriptor
deprecated
added in
v0.1.0
func (*StealTableOwnershipResponse) Descriptor() ([]byte, []int)
Deprecated: Use StealTableOwnershipResponse.ProtoReflect.Descriptor instead.
func (*StealTableOwnershipResponse) GetHighestBallot ¶ added in v0.2.0
func (x *StealTableOwnershipResponse) GetHighestBallot() *Ballot
func (*StealTableOwnershipResponse) GetHighestSlot ¶ added in v0.2.0
func (x *StealTableOwnershipResponse) GetHighestSlot() *Slot
func (*StealTableOwnershipResponse) GetMissingRecords ¶ added in v0.2.0
func (x *StealTableOwnershipResponse) GetMissingRecords() []*RecordMutation
func (*StealTableOwnershipResponse) GetPromised ¶ added in v0.1.0
func (x *StealTableOwnershipResponse) GetPromised() bool
func (*StealTableOwnershipResponse) ProtoMessage ¶ added in v0.1.0
func (*StealTableOwnershipResponse) ProtoMessage()
func (*StealTableOwnershipResponse) ProtoReflect ¶ added in v0.1.0
func (x *StealTableOwnershipResponse) ProtoReflect() protoreflect.Message
func (*StealTableOwnershipResponse) Reset ¶ added in v0.1.0
func (x *StealTableOwnershipResponse) Reset()
func (*StealTableOwnershipResponse) String ¶ added in v0.1.0
func (x *StealTableOwnershipResponse) String() string
type StructuredKey ¶ added in v0.2.0
type UnimplementedConsensusServer ¶ added in v0.1.0
type UnimplementedConsensusServer struct{}
UnimplementedConsensusServer 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 (UnimplementedConsensusServer) AcceptMigration ¶ added in v0.1.0
func (UnimplementedConsensusServer) AcceptMigration(context.Context, *WriteMigrationRequest) (*emptypb.Empty, error)
func (UnimplementedConsensusServer) DeReference ¶ added in v0.2.0
func (UnimplementedConsensusServer) DeReference(*DereferenceRequest, grpc.ServerStreamingServer[DereferenceResponse]) error
func (UnimplementedConsensusServer) Follow ¶ added in v0.2.0
func (UnimplementedConsensusServer) Follow(*SlotRequest, grpc.ServerStreamingServer[RecordMutation]) error
func (UnimplementedConsensusServer) Ping ¶ added in v0.1.0
func (UnimplementedConsensusServer) Ping(context.Context, *PingRequest) (*PingResponse, error)
func (UnimplementedConsensusServer) PrefixScan ¶ added in v0.1.0
func (UnimplementedConsensusServer) PrefixScan(context.Context, *PrefixScanRequest) (*PrefixScanResponse, error)
func (UnimplementedConsensusServer) ReadRecord ¶ added in v0.2.0
func (UnimplementedConsensusServer) ReadRecord(context.Context, *ReadRecordRequest) (*ReadRecordResponse, error)
func (UnimplementedConsensusServer) Replicate ¶ added in v0.2.0
func (UnimplementedConsensusServer) Replicate(grpc.ClientStreamingServer[ReplicationRequest, ReplicationResponse]) error
func (UnimplementedConsensusServer) RequestSlots ¶ added in v0.2.0
func (UnimplementedConsensusServer) RequestSlots(*SlotRequest, grpc.ServerStreamingServer[RecordMutation]) error
func (UnimplementedConsensusServer) StealTableOwnership ¶ added in v0.1.0
func (UnimplementedConsensusServer) StealTableOwnership(context.Context, *StealTableOwnershipRequest) (*StealTableOwnershipResponse, error)
func (UnimplementedConsensusServer) WriteMigration ¶ added in v0.1.0
func (UnimplementedConsensusServer) WriteMigration(context.Context, *WriteMigrationRequest) (*WriteMigrationResponse, error)
type UnsafeConsensusServer ¶ added in v0.1.0
type UnsafeConsensusServer interface {
// contains filtered or unexported methods
}
UnsafeConsensusServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ConsensusServer will result in compilation errors.
type WriteKeyRequest ¶ added in v0.1.0
type WriteKeyRequest struct {
Sender *Node `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` // The node requesting the write
Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` // The table the key belongs to
Mutation *RecordMutation `protobuf:"bytes,4,opt,name=mutation,proto3" json:"mutation,omitempty"`
// contains filtered or unexported fields
}
func (*WriteKeyRequest) Descriptor
deprecated
added in
v0.1.0
func (*WriteKeyRequest) Descriptor() ([]byte, []int)
Deprecated: Use WriteKeyRequest.ProtoReflect.Descriptor instead.
func (*WriteKeyRequest) GetKey ¶ added in v0.2.0
func (x *WriteKeyRequest) GetKey() []byte
func (*WriteKeyRequest) GetMutation ¶ added in v0.2.0
func (x *WriteKeyRequest) GetMutation() *RecordMutation
func (*WriteKeyRequest) GetSender ¶ added in v0.1.0
func (x *WriteKeyRequest) GetSender() *Node
func (*WriteKeyRequest) ProtoMessage ¶ added in v0.1.0
func (*WriteKeyRequest) ProtoMessage()
func (*WriteKeyRequest) ProtoReflect ¶ added in v0.1.0
func (x *WriteKeyRequest) ProtoReflect() protoreflect.Message
func (*WriteKeyRequest) Reset ¶ added in v0.1.0
func (x *WriteKeyRequest) Reset()
func (*WriteKeyRequest) String ¶ added in v0.1.0
func (x *WriteKeyRequest) String() string
type WriteKeyResponse ¶ added in v0.1.0
type WriteKeyResponse struct {
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // Whether the write was successful
// contains filtered or unexported fields
}
func (*WriteKeyResponse) Descriptor
deprecated
added in
v0.1.0
func (*WriteKeyResponse) Descriptor() ([]byte, []int)
Deprecated: Use WriteKeyResponse.ProtoReflect.Descriptor instead.
func (*WriteKeyResponse) GetSuccess ¶ added in v0.1.0
func (x *WriteKeyResponse) GetSuccess() bool
func (*WriteKeyResponse) ProtoMessage ¶ added in v0.1.0
func (*WriteKeyResponse) ProtoMessage()
func (*WriteKeyResponse) ProtoReflect ¶ added in v0.1.0
func (x *WriteKeyResponse) ProtoReflect() protoreflect.Message
func (*WriteKeyResponse) Reset ¶ added in v0.1.0
func (x *WriteKeyResponse) Reset()
func (*WriteKeyResponse) String ¶ added in v0.1.0
func (x *WriteKeyResponse) String() string
type WriteMigrationRequest ¶ added in v0.1.0
type WriteMigrationRequest struct {
Record *RecordMutation `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"`
// contains filtered or unexported fields
}
func (*WriteMigrationRequest) Descriptor
deprecated
added in
v0.1.0
func (*WriteMigrationRequest) Descriptor() ([]byte, []int)
Deprecated: Use WriteMigrationRequest.ProtoReflect.Descriptor instead.
func (*WriteMigrationRequest) GetRecord ¶ added in v0.2.0
func (x *WriteMigrationRequest) GetRecord() *RecordMutation
func (*WriteMigrationRequest) ProtoMessage ¶ added in v0.1.0
func (*WriteMigrationRequest) ProtoMessage()
func (*WriteMigrationRequest) ProtoReflect ¶ added in v0.1.0
func (x *WriteMigrationRequest) ProtoReflect() protoreflect.Message
func (*WriteMigrationRequest) Reset ¶ added in v0.1.0
func (x *WriteMigrationRequest) Reset()
func (*WriteMigrationRequest) String ¶ added in v0.1.0
func (x *WriteMigrationRequest) String() string
type WriteMigrationResponse ¶ added in v0.1.0
type WriteMigrationResponse struct {
Accepted bool `protobuf:"varint,1,opt,name=accepted,proto3" json:"accepted,omitempty"`
// contains filtered or unexported fields
}
func (*WriteMigrationResponse) Descriptor
deprecated
added in
v0.1.0
func (*WriteMigrationResponse) Descriptor() ([]byte, []int)
Deprecated: Use WriteMigrationResponse.ProtoReflect.Descriptor instead.
func (*WriteMigrationResponse) GetAccepted ¶ added in v0.2.0
func (x *WriteMigrationResponse) GetAccepted() bool
func (*WriteMigrationResponse) ProtoMessage ¶ added in v0.1.0
func (*WriteMigrationResponse) ProtoMessage()
func (*WriteMigrationResponse) ProtoReflect ¶ added in v0.1.0
func (x *WriteMigrationResponse) ProtoReflect() protoreflect.Message
func (*WriteMigrationResponse) Reset ¶ added in v0.1.0
func (x *WriteMigrationResponse) Reset()
func (*WriteMigrationResponse) String ¶ added in v0.1.0
func (x *WriteMigrationResponse) String() string