Documentation ¶
Index ¶
- type CreatePartitionTableRequest
- type CreateTableRequest
- type DropTableRequest
- type Factory
- func (f *Factory) CreateDropTableProcedure(ctx context.Context, request DropTableRequest) (procedure.Procedure, error)
- func (f *Factory) CreateScatterProcedure(ctx context.Context, request ScatterRequest) (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 RandomBalancedShardPicker
- type ScatterRequest
- type Scheduler
- type ShardPicker
- type SplitRequest
- type TransferLeaderRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreatePartitionTableRequest ¶ added in v1.0.0
type CreatePartitionTableRequest struct { Cluster *cluster.Cluster SourceReq *metaservicepb.CreateTableRequest PartitionTableRatioOfNodes float32 OnSucceeded func(cluster.CreateTableResult) error OnFailed func(error) error }
type CreateTableRequest ¶ added in v1.0.0
type CreateTableRequest struct { Cluster *cluster.Cluster SourceReq *metaservicepb.CreateTableRequest OnSucceeded func(cluster.CreateTableResult) error OnFailed func(error) error }
type DropTableRequest ¶ added in v1.0.0
type DropTableRequest struct { Cluster *cluster.Cluster SourceReq *metaservicepb.DropTableRequest OnSucceeded func(cluster.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) CreateScatterProcedure ¶ 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 RandomBalancedShardPicker ¶ added in v1.0.0
type RandomBalancedShardPicker struct {
// contains filtered or unexported fields
}
RandomBalancedShardPicker randomly pick up shards that are not on the same node in the current cluster.
func (*RandomBalancedShardPicker) PickShards ¶ added in v1.0.0
func (p *RandomBalancedShardPicker) PickShards(ctx context.Context, clusterName string, expectShardNum int, enableDuplicateNode bool) ([]cluster.ShardNodeWithVersion, error)
PickShards will pick a specified number of shards as expectShardNum.
type ScatterRequest ¶ added in v1.0.0
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
func NewScheduler ¶
func (*Scheduler) ProcessHeartbeat ¶
func (s *Scheduler) ProcessHeartbeat(_ context.Context, _ *metaservicepb.NodeInfo)
type ShardPicker ¶ added in v1.0.0
type ShardPicker interface {
PickShards(ctx context.Context, clusterName string, expectShardNum int, enableDuplicateNode bool) ([]cluster.ShardNodeWithVersion, 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: If enableDuplicateNode is false, pick shards will be failed and return error. If enableDuplicateNode is true, pick shard will return shards on the same node. TODO: Consider refactor this interface, abstracts the parameters of PickShards as PickStrategy.
func NewRandomBalancedShardPicker ¶ added in v1.0.0
func NewRandomBalancedShardPicker(manager cluster.Manager) ShardPicker
type SplitRequest ¶ added in v1.0.0
Click to show internal directories.
Click to hide internal directories.