Documentation ¶
Index ¶
- type Optimist
- func (o *Optimist) AddTable(info optimism.Info) (int64, error)
- func (o *Optimist) CheckPersistentData(source string, schemas map[string]string, tables map[string]map[string]string) error
- func (o *Optimist) ConstructInfo(upSchema, upTable, downSchema, downTable string, ddls []string, ...) optimism.Info
- func (o *Optimist) DoneOperation(op optimism.Operation) error
- func (o *Optimist) DoneRedirectOperation(targetTableID string)
- func (o *Optimist) GetOperation(ctx context.Context, info optimism.Info, rev int64) (optimism.Operation, error)
- func (o *Optimist) GetRedirectOperation(ctx context.Context, info optimism.Info, rev int64)
- func (o *Optimist) Init(sourceTables map[string]map[string]map[string]map[string]struct{}) error
- func (o *Optimist) PendingInfo() *optimism.Info
- func (o *Optimist) PendingOperation() *optimism.Operation
- func (o *Optimist) PendingRedirectOperation() (*optimism.Operation, string)
- func (o *Optimist) PutInfo(info optimism.Info) (int64, error)
- func (o *Optimist) RemoveTable(info optimism.Info) (int64, error)
- func (o *Optimist) Reset()
- func (o *Optimist) Tables() [][]filter.Table
- type Pessimist
- func (p *Pessimist) ConstructInfo(schema, table string, ddls []string) pessimism.Info
- func (p *Pessimist) DoneOperationDeleteInfo(op pessimism.Operation, info pessimism.Info) error
- func (p *Pessimist) GetOperation(ctx context.Context, info pessimism.Info, rev int64) (pessimism.Operation, error)
- func (p *Pessimist) PendingInfo() *pessimism.Info
- func (p *Pessimist) PendingOperation() *pessimism.Operation
- func (p *Pessimist) PutInfo(ctx context.Context, info pessimism.Info) (int64, error)
- func (p *Pessimist) Reset()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Optimist ¶
type Optimist struct {
// contains filtered or unexported fields
}
Optimist used to coordinate the shard DDL migration in optimism mode.
func NewOptimist ¶
NewOptimist creates a new Optimist instance.
func (*Optimist) AddTable ¶
AddTable adds the table for the info into source tables, this is often called for `CREATE TABLE`.
func (*Optimist) CheckPersistentData ¶
func (o *Optimist) CheckPersistentData(source string, schemas map[string]string, tables map[string]map[string]string) error
CheckPersistentData check and fix the persistent data.
NOTE: currently this function is not used because user will meet error at early version if set unsupported case-sensitive.
func (*Optimist) ConstructInfo ¶
func (o *Optimist) ConstructInfo(upSchema, upTable, downSchema, downTable string, ddls []string, tiBefore *model.TableInfo, tisAfter []*model.TableInfo, ) optimism.Info
ConstructInfo constructs a shard DDL info.
func (*Optimist) DoneOperation ¶
DoneOperation marks the shard DDL lock operation as done.
func (*Optimist) DoneRedirectOperation ¶
DoneRedirectOperation marks the redirect shard DDL lock operation as done.
func (*Optimist) GetOperation ¶
func (o *Optimist) GetOperation(ctx context.Context, info optimism.Info, rev int64) (optimism.Operation, error)
GetOperation gets the shard DDL lock operation relative to the shard DDL info.
func (*Optimist) GetRedirectOperation ¶
func (*Optimist) Init ¶
Init initializes the optimist with source tables. NOTE: this will PUT the initial source tables into etcd (and overwrite any previous existing tables). NOTE: we do not remove source tables for `stop-task` now, may need to handle it for `remove-meta`.
func (*Optimist) PendingInfo ¶
PendingInfo returns the shard DDL info which is pending to handle.
func (*Optimist) PendingOperation ¶
PendingOperation returns the shard DDL lock operation which is pending to handle.
func (*Optimist) PendingRedirectOperation ¶
PendingRedirectOperation returns the shard DDL lock redirect operation which is pending to handle.
func (*Optimist) RemoveTable ¶
RemoveTable removes the table for the info from source tables, this is often called for `DROP TABLE`.
type Pessimist ¶
type Pessimist struct {
// contains filtered or unexported fields
}
Pessimist used to coordinate the shard DDL migration in pessimism mode.
func NewPessimist ¶
NewPessimist creates a new Pessimist instance.
func (*Pessimist) ConstructInfo ¶
ConstructInfo constructs a shard DDL info.
func (*Pessimist) DoneOperationDeleteInfo ¶
DoneOperationDeleteInfo marks the shard DDL lock operation as done and delete the shard DDL info.
func (*Pessimist) GetOperation ¶
func (p *Pessimist) GetOperation(ctx context.Context, info pessimism.Info, rev int64) (pessimism.Operation, error)
GetOperation gets the shard DDL lock operation relative to the shard DDL info.
func (*Pessimist) PendingInfo ¶
PendingInfo returns the shard DDL info which is pending to handle.
func (*Pessimist) PendingOperation ¶
PendingOperation returns the shard DDL lock operation which is pending to handle.