Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterClusterServiceServer(s grpc.ServiceRegistrar, srv ClusterServiceServer)
- type ClusterServiceClient
- type ClusterServiceServer
- type ClusterState
- func (*ClusterState) Descriptor() ([]byte, []int)deprecated
- func (x *ClusterState) GetEpoch() uint64
- func (x *ClusterState) GetNodes() []*NodeInfo
- func (*ClusterState) ProtoMessage()
- func (x *ClusterState) ProtoReflect() protoreflect.Message
- func (x *ClusterState) Reset()
- func (x *ClusterState) String() string
- type ClusterTopology
- func (*ClusterTopology) Descriptor() ([]byte, []int)deprecated
- func (x *ClusterTopology) GetEpoch() uint64
- func (x *ClusterTopology) GetNodes() []*NodeInfo
- func (x *ClusterTopology) GetRingConfig() *RingConfig
- func (*ClusterTopology) ProtoMessage()
- func (x *ClusterTopology) ProtoReflect() protoreflect.Message
- func (x *ClusterTopology) Reset()
- func (x *ClusterTopology) String() string
- type Empty
- type NodeInfo
- func (*NodeInfo) Descriptor() ([]byte, []int)deprecated
- func (x *NodeInfo) GetAddress() string
- func (x *NodeInfo) GetId() string
- func (x *NodeInfo) GetJoinedAt() uint64
- func (x *NodeInfo) GetListenAddress() string
- func (x *NodeInfo) GetStatus() NodeStatus
- func (x *NodeInfo) GetWeight() float64
- func (*NodeInfo) ProtoMessage()
- func (x *NodeInfo) ProtoReflect() protoreflect.Message
- func (x *NodeInfo) Reset()
- func (x *NodeInfo) String() string
- type NodeStatus
- type NodeTokens
- type RingConfig
- func (*RingConfig) Descriptor() ([]byte, []int)deprecated
- func (x *RingConfig) GetNodeTokens() []*NodeTokens
- func (x *RingConfig) GetReplicationFactor() int32
- func (*RingConfig) ProtoMessage()
- func (x *RingConfig) ProtoReflect() protoreflect.Message
- func (x *RingConfig) Reset()
- func (x *RingConfig) String() string
- type UnimplementedClusterServiceServer
- type UnsafeClusterServiceServer
Constants ¶
const ( ClusterService_GetClusterState_FullMethodName = "/cache.ClusterService/GetClusterState" ClusterService_GetClusterTopology_FullMethodName = "/cache.ClusterService/GetClusterTopology" )
Variables ¶
var ( NodeStatus_name = map[int32]string{ 0: "NODE_STATUS_ACTIVE", 1: "NODE_STATUS_JOINING", 2: "NODE_STATUS_LEAVING", 3: "NODE_STATUS_DOWN", } NodeStatus_value = map[string]int32{ "NODE_STATUS_ACTIVE": 0, "NODE_STATUS_JOINING": 1, "NODE_STATUS_LEAVING": 2, "NODE_STATUS_DOWN": 3, } )
Enum value maps for NodeStatus.
var ClusterService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "cache.ClusterService", HandlerType: (*ClusterServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetClusterState", Handler: _ClusterService_GetClusterState_Handler, }, { MethodName: "GetClusterTopology", Handler: _ClusterService_GetClusterTopology_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "cluster.proto", }
ClusterService_ServiceDesc is the grpc.ServiceDesc for ClusterService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_cluster_proto protoreflect.FileDescriptor
Functions ¶
func RegisterClusterServiceServer ¶
func RegisterClusterServiceServer(s grpc.ServiceRegistrar, srv ClusterServiceServer)
Types ¶
type ClusterServiceClient ¶
type ClusterServiceClient interface {
// GetClusterState returns the current cluster membership
GetClusterState(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ClusterState, error)
// GetClusterTopology returns full cluster topology including ring configuration
GetClusterTopology(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ClusterTopology, error)
}
ClusterServiceClient is the client API for ClusterService 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 NewClusterServiceClient ¶
func NewClusterServiceClient(cc grpc.ClientConnInterface) ClusterServiceClient
type ClusterServiceServer ¶
type ClusterServiceServer interface {
// GetClusterState returns the current cluster membership
GetClusterState(context.Context, *Empty) (*ClusterState, error)
// GetClusterTopology returns full cluster topology including ring configuration
GetClusterTopology(context.Context, *Empty) (*ClusterTopology, error)
// contains filtered or unexported methods
}
ClusterServiceServer is the server API for ClusterService service. All implementations must embed UnimplementedClusterServiceServer for forward compatibility
type ClusterState ¶
type ClusterState struct {
Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"`
Nodes []*NodeInfo `protobuf:"bytes,2,rep,name=nodes,proto3" json:"nodes,omitempty"`
// contains filtered or unexported fields
}
Cluster state
func (*ClusterState) Descriptor
deprecated
func (*ClusterState) Descriptor() ([]byte, []int)
Deprecated: Use ClusterState.ProtoReflect.Descriptor instead.
func (*ClusterState) GetEpoch ¶
func (x *ClusterState) GetEpoch() uint64
func (*ClusterState) GetNodes ¶
func (x *ClusterState) GetNodes() []*NodeInfo
func (*ClusterState) ProtoMessage ¶
func (*ClusterState) ProtoMessage()
func (*ClusterState) ProtoReflect ¶
func (x *ClusterState) ProtoReflect() protoreflect.Message
func (*ClusterState) Reset ¶
func (x *ClusterState) Reset()
func (*ClusterState) String ¶
func (x *ClusterState) String() string
type ClusterTopology ¶
type ClusterTopology struct {
Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"`
Nodes []*NodeInfo `protobuf:"bytes,2,rep,name=nodes,proto3" json:"nodes,omitempty"`
RingConfig *RingConfig `protobuf:"bytes,3,opt,name=ring_config,json=ringConfig,proto3" json:"ring_config,omitempty"`
// contains filtered or unexported fields
}
Cluster topology with token-based ring configuration
func (*ClusterTopology) Descriptor
deprecated
func (*ClusterTopology) Descriptor() ([]byte, []int)
Deprecated: Use ClusterTopology.ProtoReflect.Descriptor instead.
func (*ClusterTopology) GetEpoch ¶
func (x *ClusterTopology) GetEpoch() uint64
func (*ClusterTopology) GetNodes ¶
func (x *ClusterTopology) GetNodes() []*NodeInfo
func (*ClusterTopology) GetRingConfig ¶
func (x *ClusterTopology) GetRingConfig() *RingConfig
func (*ClusterTopology) ProtoMessage ¶
func (*ClusterTopology) ProtoMessage()
func (*ClusterTopology) ProtoReflect ¶
func (x *ClusterTopology) ProtoReflect() protoreflect.Message
func (*ClusterTopology) Reset ¶
func (x *ClusterTopology) Reset()
func (*ClusterTopology) String ¶
func (x *ClusterTopology) String() string
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
Empty message for requests with no parameters
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
type NodeInfo ¶
type NodeInfo struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // Cluster communication address (for gossip)
Status NodeStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cache.NodeStatus" json:"status,omitempty"`
JoinedAt uint64 `protobuf:"varint,4,opt,name=joined_at,json=joinedAt,proto3" json:"joined_at,omitempty"`
Weight float64 `protobuf:"fixed64,5,opt,name=weight,proto3" json:"weight,omitempty"`
ListenAddress string `protobuf:"bytes,6,opt,name=listen_address,json=listenAddress,proto3" json:"listen_address,omitempty"` // Service listen address for client requests (Put/Get/Delete)
// contains filtered or unexported fields
}
Node information
func (*NodeInfo) Descriptor
deprecated
func (*NodeInfo) GetAddress ¶
func (*NodeInfo) GetJoinedAt ¶
func (*NodeInfo) GetListenAddress ¶
func (*NodeInfo) GetStatus ¶
func (x *NodeInfo) GetStatus() NodeStatus
func (*NodeInfo) ProtoMessage ¶
func (*NodeInfo) ProtoMessage()
func (*NodeInfo) ProtoReflect ¶
func (x *NodeInfo) ProtoReflect() protoreflect.Message
type NodeStatus ¶
type NodeStatus int32
Node status enum
const ( NodeStatus_NODE_STATUS_ACTIVE NodeStatus = 0 NodeStatus_NODE_STATUS_JOINING NodeStatus = 1 NodeStatus_NODE_STATUS_LEAVING NodeStatus = 2 NodeStatus_NODE_STATUS_DOWN NodeStatus = 3 )
func (NodeStatus) Descriptor ¶
func (NodeStatus) Descriptor() protoreflect.EnumDescriptor
func (NodeStatus) Enum ¶
func (x NodeStatus) Enum() *NodeStatus
func (NodeStatus) EnumDescriptor
deprecated
func (NodeStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use NodeStatus.Descriptor instead.
func (NodeStatus) Number ¶
func (x NodeStatus) Number() protoreflect.EnumNumber
func (NodeStatus) String ¶
func (x NodeStatus) String() string
func (NodeStatus) Type ¶
func (NodeStatus) Type() protoreflect.EnumType
type NodeTokens ¶
type NodeTokens struct {
NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"`
Tokens []uint32 `protobuf:"varint,2,rep,packed,name=tokens,proto3" json:"tokens,omitempty"` // Sorted list of tokens owned by this node
// contains filtered or unexported fields
}
Token assignments per node for consistent hashing
func (*NodeTokens) Descriptor
deprecated
func (*NodeTokens) Descriptor() ([]byte, []int)
Deprecated: Use NodeTokens.ProtoReflect.Descriptor instead.
func (*NodeTokens) GetNodeId ¶
func (x *NodeTokens) GetNodeId() string
func (*NodeTokens) GetTokens ¶
func (x *NodeTokens) GetTokens() []uint32
func (*NodeTokens) ProtoMessage ¶
func (*NodeTokens) ProtoMessage()
func (*NodeTokens) ProtoReflect ¶
func (x *NodeTokens) ProtoReflect() protoreflect.Message
func (*NodeTokens) Reset ¶
func (x *NodeTokens) Reset()
func (*NodeTokens) String ¶
func (x *NodeTokens) String() string
type RingConfig ¶
type RingConfig struct {
ReplicationFactor int32 `protobuf:"varint,1,opt,name=replication_factor,json=replicationFactor,proto3" json:"replication_factor,omitempty"` // Data replication factor (1 = no replication)
NodeTokens []*NodeTokens `protobuf:"bytes,2,rep,name=node_tokens,json=nodeTokens,proto3" json:"node_tokens,omitempty"` // Token assignments per node
// contains filtered or unexported fields
}
Ring configuration for clients to replicate hashing
func (*RingConfig) Descriptor
deprecated
func (*RingConfig) Descriptor() ([]byte, []int)
Deprecated: Use RingConfig.ProtoReflect.Descriptor instead.
func (*RingConfig) GetNodeTokens ¶
func (x *RingConfig) GetNodeTokens() []*NodeTokens
func (*RingConfig) GetReplicationFactor ¶
func (x *RingConfig) GetReplicationFactor() int32
func (*RingConfig) ProtoMessage ¶
func (*RingConfig) ProtoMessage()
func (*RingConfig) ProtoReflect ¶
func (x *RingConfig) ProtoReflect() protoreflect.Message
func (*RingConfig) Reset ¶
func (x *RingConfig) Reset()
func (*RingConfig) String ¶
func (x *RingConfig) String() string
type UnimplementedClusterServiceServer ¶
type UnimplementedClusterServiceServer struct {
}
UnimplementedClusterServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedClusterServiceServer) GetClusterState ¶
func (UnimplementedClusterServiceServer) GetClusterState(context.Context, *Empty) (*ClusterState, error)
func (UnimplementedClusterServiceServer) GetClusterTopology ¶
func (UnimplementedClusterServiceServer) GetClusterTopology(context.Context, *Empty) (*ClusterTopology, error)
type UnsafeClusterServiceServer ¶
type UnsafeClusterServiceServer interface {
// contains filtered or unexported methods
}
UnsafeClusterServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ClusterServiceServer will result in compilation errors.