resharding

package
v2.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: May 22, 2017 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Sequential means that the tasks will run sequentially.
	Sequential level = iota
	//Parallel means that the tasks will run in parallel.
	Parallel
)

Variables

This section is empty.

Functions

func Register

func Register()

Register registers the HorizontalReshardingWorkflowFactory as a factory in the workflow framework.

Types

type CheckpointWriter

type CheckpointWriter struct {
	// contains filtered or unexported fields
}

CheckpointWriter saves the checkpoint data into topology server.

func NewCheckpointWriter

func NewCheckpointWriter(ts topo.Server, checkpoint *workflowpb.WorkflowCheckpoint, wi *topo.WorkflowInfo) *CheckpointWriter

NewCheckpointWriter creates a CheckpointWriter.

func (*CheckpointWriter) UpdateTask

func (c *CheckpointWriter) UpdateTask(taskID string, status workflowpb.TaskState, err error) error

UpdateTask updates the task status in the checkpointing copy and saves the full checkpoint to the topology server.

type HorizontalReshardingWorkflow

type HorizontalReshardingWorkflow struct {
	// contains filtered or unexported fields
}

HorizontalReshardingWorkflow contains meta-information and methods to control the horizontal resharding workflow.

func (*HorizontalReshardingWorkflow) GetTasks

func (hw *HorizontalReshardingWorkflow) GetTasks(phase PhaseType) []*workflowpb.Task

GetTasks returns selected tasks for a phase from the checkpoint with expected execution order.

func (*HorizontalReshardingWorkflow) Run

Run executes the horizontal resharding process. It implements the workflow.Workflow interface.

type HorizontalReshardingWorkflowFactory

type HorizontalReshardingWorkflowFactory struct{}

HorizontalReshardingWorkflowFactory is the factory to create a horizontal resharding workflow.

func (*HorizontalReshardingWorkflowFactory) Init

Init is part of the workflow.Factory interface.

func (*HorizontalReshardingWorkflowFactory) Instantiate

Instantiate is part the workflow.Factory interface.

type ParallelRunner

type ParallelRunner struct {
	// contains filtered or unexported fields
}

ParallelRunner is used to control executing tasks concurrently. Each phase has its own ParallelRunner object.

func NewParallelRunner

func NewParallelRunner(ctx context.Context, rootUINode *workflow.Node, cp *CheckpointWriter, tasks []*workflowpb.Task, executeFunc func(context.Context, *workflowpb.Task) error, concurrencyLevel level, enableApprovals bool) *ParallelRunner

NewParallelRunner returns a new ParallelRunner.

func (*ParallelRunner) Action

func (p *ParallelRunner) Action(ctx context.Context, path, name string) error

Action handles retrying, approval of the first task and approval of the remaining tasks actions. It implements the interface ActionListener.

func (*ParallelRunner) Run

func (p *ParallelRunner) Run() error

Run is the entry point for controling task executions.

type PhaseType

type PhaseType string

PhaseType is used to store the phase name in a workflow.

type ReshardingWrangler

type ReshardingWrangler interface {
	CopySchemaShardFromShard(ctx context.Context, tables, excludeTables []string, includeViews bool, sourceKeyspace, sourceShard, destKeyspace, destShard string, waitSlaveTimeout time.Duration) error

	WaitForFilteredReplication(ctx context.Context, keyspace, shard string, maxDelay time.Duration) error

	MigrateServedTypes(ctx context.Context, keyspace, shard string, cells []string, servedType topodatapb.TabletType, reverse, skipReFreshState bool, filteredReplicationWaitTime time.Duration) error
}

ReshardingWrangler is the interface to be used in creating mock interface for wrangler, which is used for unit test. It includes a subset of the methods in go/vt/Wrangler.

Jump to

Keyboard shortcuts

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