Documentation ¶
Overview ¶
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 ¶
- func Register()
- func RegisterKeyspaceValidator()
- func RegisterShardValidator()
- func RegisterUITestValidator()
- func RegisterValidator(name string, v Validator)
- type Fixer
- type KeyspaceFixer
- type KeyspaceValidator
- type ShardFixer
- type ShardValidator
- type UITestFixer
- type UITestValidator
- type Validator
- type Workflow
- type WorkflowFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterKeyspaceValidator ¶
func RegisterKeyspaceValidator()
RegisterKeyspaceValidator registers the Keyspace Validator.
func RegisterShardValidator ¶
func RegisterShardValidator()
RegisterShardValidator registers the Shard Validator.
func RegisterUITestValidator ¶
func RegisterUITestValidator()
RegisterUITestValidator registers the UITest Validator.
func RegisterValidator ¶
RegisterValidator adds a Validator to our list. Typically called at init() time.
Types ¶
type Fixer ¶
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 ¶
type KeyspaceFixer struct {
// contains filtered or unexported fields
}
KeyspaceFixer implements Fixer.
type ShardFixer ¶
type ShardFixer struct {
// contains filtered or unexported fields
}
ShardFixer implements Fixer.
type Validator ¶
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 ¶
type Workflow struct {
// contains filtered or unexported fields
}
Workflow is the workflow that runs the validation. It implements workflow.Workflow.
type WorkflowFactory ¶
type WorkflowFactory struct{}
WorkflowFactory is the factory to register the topo validator workflow.
func (*WorkflowFactory) Init ¶
func (f *WorkflowFactory) Init(_ *workflow.Manager, w *workflowpb.Workflow, args []string) error
Init is part of the workflow.Factory interface.
func (*WorkflowFactory) Instantiate ¶
func (f *WorkflowFactory) Instantiate(_ *workflow.Manager, w *workflowpb.Workflow, rootNode *workflow.Node) (workflow.Workflow, error)
Instantiate is part of the workflow.Factory interface.