Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterConfig ¶
type ClusterConfig struct {
Namespaces []NamespaceConfig `json:"namespaces" yaml:"namespaces"`
Servers []Server `json:"servers" yaml:"servers"`
// ServerMetadata is a map associating server names with their corresponding metadata.
ServerMetadata map[string]ServerMetadata `json:"serverMetadata" yaml:"serverMetadata"`
}
type ClusterStatus ¶
type ClusterStatus struct {
Namespaces map[string]NamespaceStatus `json:"namespaces" yaml:"namespaces"`
ShardIdGenerator int64 `json:"shardIdGenerator" yaml:"shardIdGenerator"`
ServerIdx uint32 `json:"serverIdx" yaml:"serverIdx"`
}
func NewClusterStatus ¶
func NewClusterStatus() *ClusterStatus
func (ClusterStatus) Clone ¶
func (c ClusterStatus) Clone() *ClusterStatus
type Int32HashRange ¶
type Int32HashRange struct {
// The minimum inclusive hash that the shard can contain
Min uint32 `json:"min"`
// The maximum inclusive hash that the shard can contain
Max uint32 `json:"max"`
}
func (Int32HashRange) Clone ¶
func (sm Int32HashRange) Clone() Int32HashRange
type NamespaceConfig ¶
type NamespaceConfig struct {
Name string `json:"name" yaml:"name"`
InitialShardCount uint32 `json:"initialShardCount" yaml:"initialShardCount"`
ReplicationFactor uint32 `json:"replicationFactor" yaml:"replicationFactor"`
NotificationsEnabled common.OptBooleanDefaultTrue `json:"notificationsEnabled" yaml:"notificationsEnabled"`
// Policies represents additional configuration policies for the namespace, such as anti-affinity rules.
Policies *policies.Policies `json:"policies,omitempty" yaml:"policies,omitempty"`
}
type NamespaceStatus ¶
type NamespaceStatus struct {
ReplicationFactor uint32 `json:"replicationFactor" yaml:"replicationFactor"`
Shards map[int64]ShardMetadata `json:"shards" yaml:"shards"`
}
func (NamespaceStatus) Clone ¶
func (n NamespaceStatus) Clone() NamespaceStatus
type Server ¶ added in v0.11.13
type Server struct {
// Name is the unique identification for clusters
Name *string `json:"name" yaml:"name"`
// Public is the endpoint that is advertised to clients
Public string `json:"public" yaml:"public"`
// Internal is the endpoint for server->server RPCs
Internal string `json:"internal" yaml:"internal"`
}
func (*Server) GetIdentifier ¶ added in v0.11.13
type ServerMetadata ¶ added in v0.12.0
type ShardMetadata ¶
type ShardMetadata struct {
Status ShardStatus `json:"status" yaml:"status"`
Term int64 `json:"term" yaml:"term"`
Leader *Server `json:"leader" yaml:"leader"`
Ensemble []Server `json:"ensemble" yaml:"ensemble"`
RemovedNodes []Server `json:"removedNodes" yaml:"removedNodes"`
Int32HashRange Int32HashRange `json:"int32HashRange" yaml:"int32HashRange"`
}
func (ShardMetadata) Clone ¶
func (sm ShardMetadata) Clone() ShardMetadata
type ShardStatus ¶
type ShardStatus uint16
const ( ShardStatusUnknown ShardStatus = iota ShardStatusSteadyState ShardStatusElection ShardStatusDeleting )
func (ShardStatus) MarshalJSON ¶
func (s ShardStatus) MarshalJSON() ([]byte, error)
MarshalJSON marshals the enum as a quoted json string.
func (ShardStatus) String ¶
func (s ShardStatus) String() string
func (*ShardStatus) UnmarshalJSON ¶
func (s *ShardStatus) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals a quoted json string to the enum value.
Click to show internal directories.
Click to hide internal directories.