Documentation ¶
Index ¶
- Variables
- type BatchRequest
- type CreatePartitionTableRequest
- type CreateTableRequest
- type DropTableRequest
- type Factory
- func (f *Factory) CreateBatchTransferLeaderProcedure(ctx context.Context, request BatchRequest) (procedure.Procedure, error)
- func (f *Factory) CreateDropTableProcedure(ctx context.Context, request DropTableRequest) (procedure.Procedure, bool, 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 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 BatchRequest ¶ added in v1.2.4
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) CreateBatchTransferLeaderProcedure ¶ added in v1.2.4
func (*Factory) CreateDropTableProcedure ¶ added in v1.0.0
func (f *Factory) CreateDropTableProcedure(ctx context.Context, request DropTableRequest) (procedure.Procedure, bool, error)
CreateDropTableProcedure creates a procedure to do drop table.
And if no error is thrown, the returned boolean value is used to tell whether the procedure is created. In some cases, e.g. the table doesn't exist, it should not be an error and false will be returned.
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 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 NewLeastTableShardPicker ¶ added in v1.2.7
func NewLeastTableShardPicker() ShardPicker
type SplitRequest ¶ added in v1.0.0
Directories ¶
Path | Synopsis |
---|---|
nodepicker/hash
Package hash provides a consistent hashing function with bounded loads.
|
Package hash provides a consistent hashing function with bounded loads. |
Click to show internal directories.
Click to hide internal directories.