Documentation ¶
Index ¶
- func NewFakeTabletManagerClient() tmclient.TabletManagerClient
- type FakeTabletManagerClient
- func (client *FakeTabletManagerClient) ApplySchema(ctx context.Context, tablet *topodatapb.Tablet, change *tmutils.SchemaChange) (*tabletmanagerdatapb.SchemaChangeResult, error)
- func (client *FakeTabletManagerClient) Backup(ctx context.Context, tablet *topodatapb.Tablet, concurrency int, ...) (logutil.EventStream, error)
- func (client *FakeTabletManagerClient) ChangeType(ctx context.Context, tablet *topodatapb.Tablet, dbType topodatapb.TabletType) error
- func (client *FakeTabletManagerClient) Close()
- func (client *FakeTabletManagerClient) DemoteMaster(ctx context.Context, tablet *topodatapb.Tablet) (string, error)
- func (client *FakeTabletManagerClient) ExecuteFetchAsAllPrivs(ctx context.Context, tablet *topodatapb.Tablet, query []byte, maxRows int, ...) (*querypb.QueryResult, error)
- func (client *FakeTabletManagerClient) ExecuteFetchAsApp(ctx context.Context, tablet *topodatapb.Tablet, usePool bool, query []byte, ...) (*querypb.QueryResult, error)
- func (client *FakeTabletManagerClient) ExecuteFetchAsDba(ctx context.Context, tablet *topodatapb.Tablet, usePool bool, query []byte, ...) (*querypb.QueryResult, error)
- func (client *FakeTabletManagerClient) ExecuteHook(ctx context.Context, tablet *topodatapb.Tablet, hk *hook.Hook) (*hook.HookResult, error)
- func (client *FakeTabletManagerClient) GetPermissions(ctx context.Context, tablet *topodatapb.Tablet) (*tabletmanagerdatapb.Permissions, error)
- func (client *FakeTabletManagerClient) GetSchema(ctx context.Context, tablet *topodatapb.Tablet, tables, excludeTables []string, ...) (*tabletmanagerdatapb.SchemaDefinition, error)
- func (client *FakeTabletManagerClient) GetSlaves(ctx context.Context, tablet *topodatapb.Tablet) ([]string, error)
- func (client *FakeTabletManagerClient) IgnoreHealthError(ctx context.Context, tablet *topodatapb.Tablet, pattern string) error
- func (client *FakeTabletManagerClient) InitMaster(ctx context.Context, tablet *topodatapb.Tablet) (string, error)
- func (client *FakeTabletManagerClient) InitSlave(ctx context.Context, tablet *topodatapb.Tablet, parent *topodatapb.TabletAlias, ...) error
- func (client *FakeTabletManagerClient) LockTables(ctx context.Context, tablet *topodatapb.Tablet) error
- func (client *FakeTabletManagerClient) MasterPosition(ctx context.Context, tablet *topodatapb.Tablet) (string, error)
- func (client *FakeTabletManagerClient) Ping(ctx context.Context, tablet *topodatapb.Tablet) error
- func (client *FakeTabletManagerClient) PopulateReparentJournal(ctx context.Context, tablet *topodatapb.Tablet, timeCreatedNS int64, ...) error
- func (client *FakeTabletManagerClient) PreflightSchema(ctx context.Context, tablet *topodatapb.Tablet, changes []string) ([]*tabletmanagerdatapb.SchemaChangeResult, error)
- func (client *FakeTabletManagerClient) PromoteSlave(ctx context.Context, tablet *topodatapb.Tablet) (string, error)
- func (client *FakeTabletManagerClient) PromoteSlaveWhenCaughtUp(ctx context.Context, tablet *topodatapb.Tablet, position string) (string, error)
- func (client *FakeTabletManagerClient) RefreshState(ctx context.Context, tablet *topodatapb.Tablet) error
- func (client *FakeTabletManagerClient) ReloadSchema(ctx context.Context, tablet *topodatapb.Tablet, waitPosition string) error
- func (client *FakeTabletManagerClient) ResetReplication(ctx context.Context, tablet *topodatapb.Tablet) error
- func (client *FakeTabletManagerClient) RestoreFromBackup(ctx context.Context, tablet *topodatapb.Tablet) (logutil.EventStream, error)
- func (client *FakeTabletManagerClient) RunHealthCheck(ctx context.Context, tablet *topodatapb.Tablet) error
- func (client *FakeTabletManagerClient) SetMaster(ctx context.Context, tablet *topodatapb.Tablet, parent *topodatapb.TabletAlias, ...) error
- func (client *FakeTabletManagerClient) SetReadOnly(ctx context.Context, tablet *topodatapb.Tablet) error
- func (client *FakeTabletManagerClient) SetReadWrite(ctx context.Context, tablet *topodatapb.Tablet) error
- func (client *FakeTabletManagerClient) SlaveStatus(ctx context.Context, tablet *topodatapb.Tablet) (*replicationdatapb.Status, error)
- func (client *FakeTabletManagerClient) SlaveWasPromoted(ctx context.Context, tablet *topodatapb.Tablet) error
- func (client *FakeTabletManagerClient) SlaveWasRestarted(ctx context.Context, tablet *topodatapb.Tablet, parent *topodatapb.TabletAlias) error
- func (client *FakeTabletManagerClient) Sleep(ctx context.Context, tablet *topodatapb.Tablet, duration time.Duration) error
- func (client *FakeTabletManagerClient) StartSlave(ctx context.Context, tablet *topodatapb.Tablet) error
- func (client *FakeTabletManagerClient) StartSlaveUntilAfter(ctx context.Context, tablet *topodatapb.Tablet, position string, ...) error
- func (client *FakeTabletManagerClient) StopReplicationAndGetStatus(ctx context.Context, tablet *topodatapb.Tablet) (*replicationdatapb.Status, error)
- func (client *FakeTabletManagerClient) StopSlave(ctx context.Context, tablet *topodatapb.Tablet) error
- func (client *FakeTabletManagerClient) StopSlaveMinimum(ctx context.Context, tablet *topodatapb.Tablet, minPos string, ...) (string, error)
- func (client *FakeTabletManagerClient) TabletExternallyReparented(ctx context.Context, tablet *topodatapb.Tablet, externalID string) error
- func (client *FakeTabletManagerClient) UndoDemoteMaster(ctx context.Context, tablet *topodatapb.Tablet) error
- func (client *FakeTabletManagerClient) UnlockTables(ctx context.Context, tablet *topodatapb.Tablet) error
- func (client *FakeTabletManagerClient) VReplicationExec(ctx context.Context, tablet *topodatapb.Tablet, query string) (*querypb.QueryResult, error)
- func (client *FakeTabletManagerClient) VReplicationWaitForPos(ctx context.Context, tablet *topodatapb.Tablet, id int, pos string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFakeTabletManagerClient ¶
func NewFakeTabletManagerClient() tmclient.TabletManagerClient
NewFakeTabletManagerClient should be used to create a new FakeTabletManagerClient. There is intentionally no init in this file with a call to RegisterTabletManagerClientFactory. There shouldn't be any legitimate use-case where we would want to start a vitess cluster with a FakeTMC, and we don't want to do it by accident.
Types ¶
type FakeTabletManagerClient ¶
type FakeTabletManagerClient struct {
// contains filtered or unexported fields
}
FakeTabletManagerClient implements tmclient.TabletManagerClient TODO(aaijazi): this is a pretty complicated and inconsistent implementation. It can't make up its mind on whether it wants to be a fake, a mock, or act like the real thing. We probably want to move it more consistently towards being a mock, once we standardize how we want to do mocks in vitess. We don't currently have a good way to configure specific return values.
func (*FakeTabletManagerClient) ApplySchema ¶
func (client *FakeTabletManagerClient) ApplySchema(ctx context.Context, tablet *topodatapb.Tablet, change *tmutils.SchemaChange) (*tabletmanagerdatapb.SchemaChangeResult, error)
ApplySchema is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) Backup ¶
func (client *FakeTabletManagerClient) Backup(ctx context.Context, tablet *topodatapb.Tablet, concurrency int, allowMaster bool) (logutil.EventStream, error)
Backup is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) ChangeType ¶
func (client *FakeTabletManagerClient) ChangeType(ctx context.Context, tablet *topodatapb.Tablet, dbType topodatapb.TabletType) error
ChangeType is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) Close ¶
func (client *FakeTabletManagerClient) Close()
Close is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) DemoteMaster ¶
func (client *FakeTabletManagerClient) DemoteMaster(ctx context.Context, tablet *topodatapb.Tablet) (string, error)
DemoteMaster is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) ExecuteFetchAsAllPrivs ¶
func (client *FakeTabletManagerClient) ExecuteFetchAsAllPrivs(ctx context.Context, tablet *topodatapb.Tablet, query []byte, maxRows int, reloadSchema bool) (*querypb.QueryResult, error)
ExecuteFetchAsAllPrivs is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) ExecuteFetchAsApp ¶
func (client *FakeTabletManagerClient) ExecuteFetchAsApp(ctx context.Context, tablet *topodatapb.Tablet, usePool bool, query []byte, maxRows int) (*querypb.QueryResult, error)
ExecuteFetchAsApp is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) ExecuteFetchAsDba ¶
func (client *FakeTabletManagerClient) ExecuteFetchAsDba(ctx context.Context, tablet *topodatapb.Tablet, usePool bool, query []byte, maxRows int, disableBinlogs, reloadSchema bool) (*querypb.QueryResult, error)
ExecuteFetchAsDba is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) ExecuteHook ¶
func (client *FakeTabletManagerClient) ExecuteHook(ctx context.Context, tablet *topodatapb.Tablet, hk *hook.Hook) (*hook.HookResult, error)
ExecuteHook is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) GetPermissions ¶
func (client *FakeTabletManagerClient) GetPermissions(ctx context.Context, tablet *topodatapb.Tablet) (*tabletmanagerdatapb.Permissions, error)
GetPermissions is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) GetSchema ¶
func (client *FakeTabletManagerClient) GetSchema(ctx context.Context, tablet *topodatapb.Tablet, tables, excludeTables []string, includeViews bool) (*tabletmanagerdatapb.SchemaDefinition, error)
GetSchema is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) GetSlaves ¶
func (client *FakeTabletManagerClient) GetSlaves(ctx context.Context, tablet *topodatapb.Tablet) ([]string, error)
GetSlaves is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) IgnoreHealthError ¶
func (client *FakeTabletManagerClient) IgnoreHealthError(ctx context.Context, tablet *topodatapb.Tablet, pattern string) error
IgnoreHealthError is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) InitMaster ¶
func (client *FakeTabletManagerClient) InitMaster(ctx context.Context, tablet *topodatapb.Tablet) (string, error)
InitMaster is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) InitSlave ¶
func (client *FakeTabletManagerClient) InitSlave(ctx context.Context, tablet *topodatapb.Tablet, parent *topodatapb.TabletAlias, position string, timeCreatedNS int64) error
InitSlave is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) LockTables ¶ added in v1.5.0
func (client *FakeTabletManagerClient) LockTables(ctx context.Context, tablet *topodatapb.Tablet) error
LockTables is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) MasterPosition ¶
func (client *FakeTabletManagerClient) MasterPosition(ctx context.Context, tablet *topodatapb.Tablet) (string, error)
MasterPosition is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) Ping ¶
func (client *FakeTabletManagerClient) Ping(ctx context.Context, tablet *topodatapb.Tablet) error
Ping is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) PopulateReparentJournal ¶
func (client *FakeTabletManagerClient) PopulateReparentJournal(ctx context.Context, tablet *topodatapb.Tablet, timeCreatedNS int64, actionName string, masterAlias *topodatapb.TabletAlias, position string) error
PopulateReparentJournal is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) PreflightSchema ¶
func (client *FakeTabletManagerClient) PreflightSchema(ctx context.Context, tablet *topodatapb.Tablet, changes []string) ([]*tabletmanagerdatapb.SchemaChangeResult, error)
PreflightSchema is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) PromoteSlave ¶
func (client *FakeTabletManagerClient) PromoteSlave(ctx context.Context, tablet *topodatapb.Tablet) (string, error)
PromoteSlave is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) PromoteSlaveWhenCaughtUp ¶
func (client *FakeTabletManagerClient) PromoteSlaveWhenCaughtUp(ctx context.Context, tablet *topodatapb.Tablet, position string) (string, error)
PromoteSlaveWhenCaughtUp is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) RefreshState ¶
func (client *FakeTabletManagerClient) RefreshState(ctx context.Context, tablet *topodatapb.Tablet) error
RefreshState is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) ReloadSchema ¶
func (client *FakeTabletManagerClient) ReloadSchema(ctx context.Context, tablet *topodatapb.Tablet, waitPosition string) error
ReloadSchema is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) ResetReplication ¶
func (client *FakeTabletManagerClient) ResetReplication(ctx context.Context, tablet *topodatapb.Tablet) error
ResetReplication is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) RestoreFromBackup ¶
func (client *FakeTabletManagerClient) RestoreFromBackup(ctx context.Context, tablet *topodatapb.Tablet) (logutil.EventStream, error)
RestoreFromBackup is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) RunHealthCheck ¶
func (client *FakeTabletManagerClient) RunHealthCheck(ctx context.Context, tablet *topodatapb.Tablet) error
RunHealthCheck is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) SetMaster ¶
func (client *FakeTabletManagerClient) SetMaster(ctx context.Context, tablet *topodatapb.Tablet, parent *topodatapb.TabletAlias, timeCreatedNS int64, forceStartSlave bool) error
SetMaster is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) SetReadOnly ¶
func (client *FakeTabletManagerClient) SetReadOnly(ctx context.Context, tablet *topodatapb.Tablet) error
SetReadOnly is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) SetReadWrite ¶
func (client *FakeTabletManagerClient) SetReadWrite(ctx context.Context, tablet *topodatapb.Tablet) error
SetReadWrite is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) SlaveStatus ¶
func (client *FakeTabletManagerClient) SlaveStatus(ctx context.Context, tablet *topodatapb.Tablet) (*replicationdatapb.Status, error)
SlaveStatus is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) SlaveWasPromoted ¶
func (client *FakeTabletManagerClient) SlaveWasPromoted(ctx context.Context, tablet *topodatapb.Tablet) error
SlaveWasPromoted is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) SlaveWasRestarted ¶
func (client *FakeTabletManagerClient) SlaveWasRestarted(ctx context.Context, tablet *topodatapb.Tablet, parent *topodatapb.TabletAlias) error
SlaveWasRestarted is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) Sleep ¶
func (client *FakeTabletManagerClient) Sleep(ctx context.Context, tablet *topodatapb.Tablet, duration time.Duration) error
Sleep is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) StartSlave ¶
func (client *FakeTabletManagerClient) StartSlave(ctx context.Context, tablet *topodatapb.Tablet) error
StartSlave is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) StartSlaveUntilAfter ¶ added in v1.5.0
func (client *FakeTabletManagerClient) StartSlaveUntilAfter(ctx context.Context, tablet *topodatapb.Tablet, position string, duration time.Duration) error
StartSlaveUntilAfter is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) StopReplicationAndGetStatus ¶
func (client *FakeTabletManagerClient) StopReplicationAndGetStatus(ctx context.Context, tablet *topodatapb.Tablet) (*replicationdatapb.Status, error)
StopReplicationAndGetStatus is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) StopSlave ¶
func (client *FakeTabletManagerClient) StopSlave(ctx context.Context, tablet *topodatapb.Tablet) error
StopSlave is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) StopSlaveMinimum ¶
func (client *FakeTabletManagerClient) StopSlaveMinimum(ctx context.Context, tablet *topodatapb.Tablet, minPos string, waitTime time.Duration) (string, error)
StopSlaveMinimum is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) TabletExternallyReparented ¶
func (client *FakeTabletManagerClient) TabletExternallyReparented(ctx context.Context, tablet *topodatapb.Tablet, externalID string) error
TabletExternallyReparented is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) UndoDemoteMaster ¶ added in v1.6.0
func (client *FakeTabletManagerClient) UndoDemoteMaster(ctx context.Context, tablet *topodatapb.Tablet) error
UndoDemoteMaster is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) UnlockTables ¶ added in v1.5.0
func (client *FakeTabletManagerClient) UnlockTables(ctx context.Context, tablet *topodatapb.Tablet) error
UnlockTables is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) VReplicationExec ¶
func (client *FakeTabletManagerClient) VReplicationExec(ctx context.Context, tablet *topodatapb.Tablet, query string) (*querypb.QueryResult, error)
VReplicationExec is part of the tmclient.TabletManagerClient interface.
func (*FakeTabletManagerClient) VReplicationWaitForPos ¶
func (client *FakeTabletManagerClient) VReplicationWaitForPos(ctx context.Context, tablet *topodatapb.Tablet, id int, pos string) error
VReplicationWaitForPos is part of the tmclient.TabletManagerClient interface.