internal

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor interface {
	ExecuteWrite(ctx context.Context, request *proto.WriteRequest) (*proto.WriteResponse, error)
	ExecuteRead(ctx context.Context, request *proto.ReadRequest) (proto.OxiaClient_ReadClient, error)
	ExecuteList(ctx context.Context, request *proto.ListRequest) (proto.OxiaClient_ListClient, error)
	ExecuteRangeScan(ctx context.Context, request *proto.RangeScanRequest) (proto.OxiaClient_RangeScanClient, error)
}

func NewExecutor added in v0.7.0

func NewExecutor(ctx context.Context, namespace string, pool common.ClientPool, manager ShardManager, serviceAddress string) Executor

type HashRange

type HashRange struct {
	MinInclusive uint32
	MaxInclusive uint32
}

type Shard

type Shard struct {
	Id        int64
	Leader    string
	HashRange HashRange
}

type ShardManager

type ShardManager interface {
	io.Closer
	Get(key string) int64
	GetAll() []int64
	Leader(shardId int64) string
}

func NewShardManager

func NewShardManager(shardStrategy ShardStrategy, clientPool common.ClientPool,
	serviceAddress string, namespace string, requestTimeout time.Duration) (ShardManager, error)

type ShardStrategy

type ShardStrategy interface {
	Get(key string) func(Shard) bool
}

func NewShardStrategy

func NewShardStrategy() ShardStrategy

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL