go-vitess.v1: gopkg.in/src-d/go-vitess.v1/vt/workflow/topovalidator Index | Files

package topovalidator

import "gopkg.in/src-d/go-vitess.v1/vt/workflow/topovalidator"

Package topovalidator contains a workflow that validates the topology data. It is meant to detect and propose fixes for topology problems. Ideally, the topology should always be consistent. However, with tasks dying or network problems, there is a risk some bad data is left in the topology. Most data problems should be self-healing, so it is important to only add new validations steps only for corner cases that would be too costly or time-consuming to address in the first place.

Index

Package Files

keyspace.go shard.go ui.go validator.go

func Register Uses

func Register()

Register needs to be called to register the topovalidator factory.

func RegisterKeyspaceValidator Uses

func RegisterKeyspaceValidator()

RegisterKeyspaceValidator registers the Keyspace Validator.

func RegisterShardValidator Uses

func RegisterShardValidator()

RegisterShardValidator registers the Shard Validator.

func RegisterUITestValidator Uses

func RegisterUITestValidator()

RegisterUITestValidator registers the UITest Validator.

func RegisterValidator Uses

func RegisterValidator(name string, v Validator)

RegisterValidator adds a Validator to our list. Typically called at init() time.

type Fixer Uses

type Fixer interface {
    Action(ctx context.Context, name string) error
}

Fixer is the interface to implement to register a job capable of fixing something in the topology. It is given the action that the user chose.

type KeyspaceFixer Uses

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

KeyspaceFixer implements Fixer.

func (*KeyspaceFixer) Action Uses

func (kf *KeyspaceFixer) Action(ctx context.Context, name string) error

Action is part of the Fixer interface.

type KeyspaceValidator Uses

type KeyspaceValidator struct{}

KeyspaceValidator implements Validator.

func (*KeyspaceValidator) Audit Uses

func (kv *KeyspaceValidator) Audit(ctx context.Context, ts *topo.Server, w *Workflow) error

Audit is part of the Validator interface.

type ShardFixer Uses

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

ShardFixer implements Fixer.

func (*ShardFixer) Action Uses

func (sf *ShardFixer) Action(ctx context.Context, name string) error

Action is part of the Fixer interface.

type ShardValidator Uses

type ShardValidator struct{}

ShardValidator implements Validator.

func (*ShardValidator) Audit Uses

func (kv *ShardValidator) Audit(ctx context.Context, ts *topo.Server, w *Workflow) error

Audit is part of the Validator interface.

type UITestFixer Uses

type UITestFixer struct{}

UITestFixer implements Fixer.

func (*UITestFixer) Action Uses

func (kf *UITestFixer) Action(ctx context.Context, name string) error

Action is part of the Fixer interface.

type UITestValidator Uses

type UITestValidator struct{}

UITestValidator implements Validator.

func (*UITestValidator) Audit Uses

func (kv *UITestValidator) Audit(ctx context.Context, ts *topo.Server, w *Workflow) error

Audit is part of the Validator interface.

type Validator Uses

type Validator interface {
    // Audit is called by the Workflow. It can add Fixer objects to the Workflow.
    Audit(ctx context.Context, ts *topo.Server, w *Workflow) error
}

Validator is an individual process that validates an aspect of the topology. Typically, it looks for something wrong, and if it finds anything, it registers a Fixer in the workflow.

type Workflow Uses

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

Workflow is the workflow that runs the validation. It implements workflow.Workflow.

func (*Workflow) AddFixer Uses

func (w *Workflow) AddFixer(name, message string, fixer Fixer, actions []string)

AddFixer adds a Fixer to the Workflow. It will end up displaying a sub-task for the user to act on. When the user presses one action, the Fixer.Action() callback will be called.

func (*Workflow) Run Uses

func (w *Workflow) Run(ctx context.Context, manager *workflow.Manager, wi *topo.WorkflowInfo) error

Run is part of the workflow.Workflow interface.

type WorkflowFactory Uses

type WorkflowFactory struct{}

WorkflowFactory is the factory to register the topo validator workflow.

func (*WorkflowFactory) Init Uses

func (f *WorkflowFactory) Init(_ *workflow.Manager, w *workflowpb.Workflow, args []string) error

Init is part of the workflow.Factory interface.

func (*WorkflowFactory) Instantiate Uses

func (f *WorkflowFactory) Instantiate(_ *workflow.Manager, w *workflowpb.Workflow, rootNode *workflow.Node) (workflow.Workflow, error)

Instantiate is part of the workflow.Factory interface.

Package topovalidator imports 9 packages (graph) and is imported by 2 packages. Updated 2019-06-13. Refresh now. Tools for package owners.