Documentation ¶
Index ¶
- func Hash(s string) uint32
- type Chunk
- type ClusterConfig
- type ClusterSize
- type DBServer
- func (s *DBServer) Get(ctx context.Context, request *api.IDRequest) (*api.Response, error)
- func (s *DBServer) Remove(ctx context.Context, request *api.IDRequest) (*api.Response, error)
- func (s *DBServer) Set(ctx context.Context, request *api.IDValueRequest) (*api.Response, error)
- func (s *DBServer) Stop()
- func (s *DBServer) Time(ctx context.Context, request *api.EmptyRequest) (*api.Response, error)
- type Shard
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClusterConfig ¶
type ClusterConfig struct { Size ClusterSize // Chunks is the list of all chunks in the system Chunks []Chunk // Shards is the list of shards in the system Shards []Shard }
ClusterConfig holds the current cluster configuration
func (*ClusterConfig) Chunk ¶
func (config *ClusterConfig) Chunk(s string) uint32
Chunk returns the 16bit chunk number for the given key.
type ClusterSize ¶
type ClusterSize uint8
ClusterSize is an enumeration for keeping track of how large a cluster is
var ( // SmallCluster is for a cluster of up to 256 shards SmallCluster ClusterSize = 1 // MediumCluster is for a cluster of up to 65,536 shards MediumCluster ClusterSize = 2 // LargeCluster is for a cluster of up to 1,6777,216 shards LargeCluster ClusterSize = 3 // HugeCluster is for a cluster of up to 4,294,967,296 shards HugeCluster ClusterSize = 4 )
noinspection GoUnusedGlobalVariable
type DBServer ¶
type DBServer struct { Logger *log.Logger Storage *storage.Instance // contains filtered or unexported fields }
DBServer is an instance of the database server
Click to show internal directories.
Click to hide internal directories.