Documentation ¶
Index ¶
- Variables
- type ConsistentHashNodePicker
- type CreatePartitionTableRequest
- type CreateTableRequest
- type DropTableRequest
- type Factory
- func (f *Factory) CreateDropTableProcedure(ctx context.Context, request DropTableRequest) (procedure.Procedure, error)
- func (f *Factory) CreateSplitProcedure(ctx context.Context, request SplitRequest) (procedure.Procedure, error)
- func (f *Factory) CreateTransferLeaderProcedure(ctx context.Context, request TransferLeaderRequest) (procedure.Procedure, error)
- func (f *Factory) MakeCreateTableProcedure(ctx context.Context, request CreateTableRequest) (procedure.Procedure, error)
- type NodePicker
- type RandomBalancedShardPicker
- type ShardPicker
- type SplitRequest
- type TransferLeaderRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNodeNumberNotEnough = coderr.NewCodeError(coderr.Internal, "node number not enough") ErrPickNode = coderr.NewCodeError(coderr.Internal, "no node is picked") )
Functions ¶
This section is empty.
Types ¶
type ConsistentHashNodePicker ¶ added in v1.2.0
type ConsistentHashNodePicker struct {
// contains filtered or unexported fields
}
func (*ConsistentHashNodePicker) PickNode ¶ added in v1.2.0
func (p *ConsistentHashNodePicker) PickNode(_ context.Context, shardID storage.ShardID, registerNodes []metadata.RegisteredNode) (metadata.RegisteredNode, error)
type CreatePartitionTableRequest ¶ added in v1.0.0
type CreatePartitionTableRequest struct { ClusterMetadata *metadata.ClusterMetadata SourceReq *metaservicepb.CreateTableRequest PartitionTableRatioOfNodes float32 OnSucceeded func(metadata.CreateTableResult) error OnFailed func(error) error }
type CreateTableRequest ¶ added in v1.0.0
type CreateTableRequest struct { ClusterMetadata *metadata.ClusterMetadata SourceReq *metaservicepb.CreateTableRequest OnSucceeded func(metadata.CreateTableResult) error OnFailed func(error) error }
type DropTableRequest ¶ added in v1.0.0
type DropTableRequest struct { ClusterMetadata *metadata.ClusterMetadata ClusterSnapshot metadata.Snapshot SourceReq *metaservicepb.DropTableRequest OnSucceeded func(metadata.TableInfo) error OnFailed func(error) error }
func (DropTableRequest) IsPartitionTable ¶ added in v1.0.0
func (d DropTableRequest) IsPartitionTable() bool
type Factory ¶ added in v1.0.0
type Factory struct {
// contains filtered or unexported fields
}
func NewFactory ¶ added in v1.0.0
func (*Factory) CreateDropTableProcedure ¶ added in v1.0.0
func (*Factory) CreateSplitProcedure ¶ added in v1.0.0
func (*Factory) CreateTransferLeaderProcedure ¶ added in v1.0.0
func (*Factory) MakeCreateTableProcedure ¶ added in v1.0.0
type NodePicker ¶ added in v1.2.0
type NodePicker interface {
PickNode(ctx context.Context, shardID storage.ShardID, registerNodes []metadata.RegisteredNode) (metadata.RegisteredNode, error)
}
func NewConsistentHashNodePicker ¶ added in v1.2.0
func NewConsistentHashNodePicker(logger *zap.Logger, hashReplicas int) NodePicker
type RandomBalancedShardPicker ¶ added in v1.0.0
type RandomBalancedShardPicker struct{}
RandomBalancedShardPicker randomly pick up shards that are not on the same node in the current cluster.
type ShardPicker ¶ added in v1.0.0
type ShardPicker interface {
PickShards(ctx context.Context, snapshot metadata.Snapshot, expectShardNum int) ([]storage.ShardNode, error)
}
ShardPicker is used to pick up the shards suitable for scheduling in the cluster. If expectShardNum bigger than cluster node number, the result depends on enableDuplicateNode: TODO: Consider refactor this interface, abstracts the parameters of PickShards as PickStrategy.
func NewRandomBalancedShardPicker ¶ added in v1.0.0
func NewRandomBalancedShardPicker() ShardPicker
type SplitRequest ¶ added in v1.0.0
Click to show internal directories.
Click to hide internal directories.