go-vitess.v1: gopkg.in/src-d/go-vitess.v1/vt/mysqlctl/fakemysqldaemon Index | Files

package fakemysqldaemon

import "gopkg.in/src-d/go-vitess.v1/vt/mysqlctl/fakemysqldaemon"

Index

Package Files

fakemysqldaemon.go

type FakeMysqlDaemon Uses

type FakeMysqlDaemon struct {

    // Running is used by Start / Shutdown
    Running bool

    // MysqlPort will be returned by GetMysqlPort(). Set to -1 to
    // return an error.
    MysqlPort int32

    // Replicating is updated when calling StartSlave / StopSlave
    // (it is not used at all when calling SlaveStatus, it is the
    // test owner responsability to have these two match)
    Replicating bool

    // CurrentMasterPosition is returned by MasterPosition
    // and SlaveStatus
    CurrentMasterPosition mysql.Position

    // SlaveStatusError is used by SlaveStatus
    SlaveStatusError error

    // CurrentMasterHost is returned by SlaveStatus
    CurrentMasterHost string

    // CurrentMasterport is returned by SlaveStatus
    CurrentMasterPort int

    // SecondsBehindMaster is returned by SlaveStatus
    SecondsBehindMaster uint

    // ReadOnly is the current value of the flag
    ReadOnly bool

    // SuperReadOnly is the current value of the flag
    SuperReadOnly bool

    // SetSlavePositionPos is matched against the input of SetSlavePosition.
    // If it doesn't match, SetSlavePosition will return an error.
    SetSlavePositionPos mysql.Position

    // StartSlaveUntilAfterPos is matched against the input
    StartSlaveUntilAfterPos mysql.Position

    // SetMasterInput is matched against the input of SetMaster
    // (as "%v:%v"). If it doesn't match, SetMaster will return an error.
    SetMasterInput string

    // WaitMasterPosition is checked by WaitMasterPos, if the
    // same it returns nil, if different it returns an error
    WaitMasterPosition mysql.Position

    // PromoteSlaveResult is returned by PromoteSlave
    PromoteSlaveResult mysql.Position

    // SchemaFunc provides the return value for GetSchema.
    // If not defined, the "Schema" field will be used instead, see below.
    SchemaFunc func() (*tabletmanagerdatapb.SchemaDefinition, error)

    // Schema will be returned by GetSchema. If nil we'll
    // return an error.
    Schema *tabletmanagerdatapb.SchemaDefinition

    // PreflightSchemaChangeResult will be returned by PreflightSchemaChange.
    // If nil we'll return an error.
    PreflightSchemaChangeResult []*tabletmanagerdatapb.SchemaChangeResult

    // ApplySchemaChangeResult will be returned by ApplySchemaChange.
    // If nil we'll return an error.
    ApplySchemaChangeResult *tabletmanagerdatapb.SchemaChangeResult

    // ExpectedExecuteSuperQueryList is what we expect
    // ExecuteSuperQueryList to be called with. If it doesn't
    // match, ExecuteSuperQueryList will return an error.
    // Note each string is just a substring if it begins with SUB,
    // so we support partial queries (usefull when queries contain
    // data fields like timestamps)
    ExpectedExecuteSuperQueryList []string

    // ExpectedExecuteSuperQueryCurrent is the current index of the queries
    // we expect
    ExpectedExecuteSuperQueryCurrent int

    // FetchSuperQueryResults is used by FetchSuperQuery
    FetchSuperQueryMap map[string]*sqltypes.Result

    // BinlogPlayerEnabled is used by {Enable,Disable}BinlogPlayer
    BinlogPlayerEnabled sync2.AtomicBool

    // SemiSyncMasterEnabled represents the state of rpl_semi_sync_master_enabled.
    SemiSyncMasterEnabled bool
    // SemiSyncSlaveEnabled represents the state of rpl_semi_sync_slave_enabled.
    SemiSyncSlaveEnabled bool

    // TimeoutHook is a func that can be called at the beginning of any method to fake a timeout.
    // all a test needs to do is make it { return context.DeadlineExceeded }
    TimeoutHook func() error
    // contains filtered or unexported fields
}

FakeMysqlDaemon implements MysqlDaemon and allows the user to fake everything.

func NewFakeMysqlDaemon Uses

func NewFakeMysqlDaemon(db *fakesqldb.DB) *FakeMysqlDaemon

NewFakeMysqlDaemon returns a FakeMysqlDaemon where mysqld appears to be running, based on a fakesqldb.DB. 'db' can be nil if the test doesn't use a database at all.

func (*FakeMysqlDaemon) ApplySchemaChange Uses

func (fmd *FakeMysqlDaemon) ApplySchemaChange(dbName string, change *tmutils.SchemaChange) (*tabletmanagerdatapb.SchemaChangeResult, error)

ApplySchemaChange is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) CheckSuperQueryList Uses

func (fmd *FakeMysqlDaemon) CheckSuperQueryList() error

CheckSuperQueryList returns an error if all the queries we expected haven't been seen.

func (*FakeMysqlDaemon) Close Uses

func (fmd *FakeMysqlDaemon) Close()

Close is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) DemoteMaster Uses

func (fmd *FakeMysqlDaemon) DemoteMaster() (mysql.Position, error)

Deprecated: use mysqld.MasterPosition() instead

func (*FakeMysqlDaemon) DisableBinlogPlayback Uses

func (fmd *FakeMysqlDaemon) DisableBinlogPlayback() error

DisableBinlogPlayback disable playback of binlog events

func (*FakeMysqlDaemon) EnableBinlogPlayback Uses

func (fmd *FakeMysqlDaemon) EnableBinlogPlayback() error

EnableBinlogPlayback is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) ExecuteSuperQueryList Uses

func (fmd *FakeMysqlDaemon) ExecuteSuperQueryList(ctx context.Context, queryList []string) error

ExecuteSuperQueryList is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) FetchSuperQuery Uses

func (fmd *FakeMysqlDaemon) FetchSuperQuery(ctx context.Context, query string) (*sqltypes.Result, error)

FetchSuperQuery returns the results from the map, if any

func (*FakeMysqlDaemon) GetAllPrivsConnection Uses

func (fmd *FakeMysqlDaemon) GetAllPrivsConnection() (*dbconnpool.DBConnection, error)

GetAllPrivsConnection is part of the MysqlDaemon interface.

func (*FakeMysqlDaemon) GetAppConnection Uses

func (fmd *FakeMysqlDaemon) GetAppConnection(ctx context.Context) (*dbconnpool.PooledDBConnection, error)

GetAppConnection is part of the MysqlDaemon interface.

func (*FakeMysqlDaemon) GetColumns Uses

func (fmd *FakeMysqlDaemon) GetColumns(dbName, table string) ([]string, error)

GetColumns is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) GetDbaConnection Uses

func (fmd *FakeMysqlDaemon) GetDbaConnection() (*dbconnpool.DBConnection, error)

GetDbaConnection is part of the MysqlDaemon interface.

func (*FakeMysqlDaemon) GetMysqlPort Uses

func (fmd *FakeMysqlDaemon) GetMysqlPort() (int32, error)

GetMysqlPort is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) GetPrimaryKeyColumns Uses

func (fmd *FakeMysqlDaemon) GetPrimaryKeyColumns(dbName, table string) ([]string, error)

GetPrimaryKeyColumns is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) GetSchema Uses

func (fmd *FakeMysqlDaemon) GetSchema(dbName string, tables, excludeTables []string, includeViews bool) (*tabletmanagerdatapb.SchemaDefinition, error)

GetSchema is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) IsReadOnly Uses

func (fmd *FakeMysqlDaemon) IsReadOnly() (bool, error)

IsReadOnly is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) MasterPosition Uses

func (fmd *FakeMysqlDaemon) MasterPosition() (mysql.Position, error)

MasterPosition is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) PreflightSchemaChange Uses

func (fmd *FakeMysqlDaemon) PreflightSchemaChange(dbName string, changes []string) ([]*tabletmanagerdatapb.SchemaChangeResult, error)

PreflightSchemaChange is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) PromoteSlave Uses

func (fmd *FakeMysqlDaemon) PromoteSlave(hookExtraEnv map[string]string) (mysql.Position, error)

PromoteSlave is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) RefreshConfig Uses

func (fmd *FakeMysqlDaemon) RefreshConfig(ctx context.Context, cnf *mysqlctl.Mycnf) error

RefreshConfig is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) ReinitConfig Uses

func (fmd *FakeMysqlDaemon) ReinitConfig(ctx context.Context, cnf *mysqlctl.Mycnf) error

ReinitConfig is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) ResetReplication Uses

func (fmd *FakeMysqlDaemon) ResetReplication(ctx context.Context) error

ResetReplication is part of the MysqlDaemon interface.

func (*FakeMysqlDaemon) RunMysqlUpgrade Uses

func (fmd *FakeMysqlDaemon) RunMysqlUpgrade() error

RunMysqlUpgrade is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) SemiSyncEnabled Uses

func (fmd *FakeMysqlDaemon) SemiSyncEnabled() (master, slave bool)

SemiSyncEnabled is part of the MysqlDaemon interface.

func (*FakeMysqlDaemon) SemiSyncSlaveStatus Uses

func (fmd *FakeMysqlDaemon) SemiSyncSlaveStatus() (bool, error)

SemiSyncSlaveStatus is part of the MysqlDaemon interface.

func (*FakeMysqlDaemon) SetMaster Uses

func (fmd *FakeMysqlDaemon) SetMaster(ctx context.Context, masterHost string, masterPort int, slaveStopBefore bool, slaveStartAfter bool) error

SetMaster is part of the MysqlDaemon interface.

func (*FakeMysqlDaemon) SetReadOnly Uses

func (fmd *FakeMysqlDaemon) SetReadOnly(on bool) error

SetReadOnly is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) SetSemiSyncEnabled Uses

func (fmd *FakeMysqlDaemon) SetSemiSyncEnabled(master, slave bool) error

SetSemiSyncEnabled is part of the MysqlDaemon interface.

func (*FakeMysqlDaemon) SetSlavePosition Uses

func (fmd *FakeMysqlDaemon) SetSlavePosition(ctx context.Context, pos mysql.Position) error

SetSlavePosition is part of the MysqlDaemon interface.

func (*FakeMysqlDaemon) SetSuperReadOnly Uses

func (fmd *FakeMysqlDaemon) SetSuperReadOnly(on bool) error

SetSuperReadOnly is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) Shutdown Uses

func (fmd *FakeMysqlDaemon) Shutdown(ctx context.Context, cnf *mysqlctl.Mycnf, waitForMysqld bool) error

Shutdown is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) SlaveStatus Uses

func (fmd *FakeMysqlDaemon) SlaveStatus() (mysql.SlaveStatus, error)

SlaveStatus is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) Start Uses

func (fmd *FakeMysqlDaemon) Start(ctx context.Context, cnf *mysqlctl.Mycnf, mysqldArgs ...string) error

Start is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) StartSlave Uses

func (fmd *FakeMysqlDaemon) StartSlave(hookExtraEnv map[string]string) error

StartSlave is part of the MysqlDaemon interface.

func (*FakeMysqlDaemon) StartSlaveUntilAfter Uses

func (fmd *FakeMysqlDaemon) StartSlaveUntilAfter(ctx context.Context, pos mysql.Position) error

StartSlaveUntilAfter is part of the MysqlDaemon interface.

func (*FakeMysqlDaemon) StopSlave Uses

func (fmd *FakeMysqlDaemon) StopSlave(hookExtraEnv map[string]string) error

StopSlave is part of the MysqlDaemon interface.

func (*FakeMysqlDaemon) Wait Uses

func (fmd *FakeMysqlDaemon) Wait(ctx context.Context, cnf *mysqlctl.Mycnf) error

Wait is part of the MysqlDaemon interface.

func (*FakeMysqlDaemon) WaitForReparentJournal Uses

func (fmd *FakeMysqlDaemon) WaitForReparentJournal(ctx context.Context, timeCreatedNS int64) error

WaitForReparentJournal is part of the MysqlDaemon interface

func (*FakeMysqlDaemon) WaitMasterPos Uses

func (fmd *FakeMysqlDaemon) WaitMasterPos(_ context.Context, pos mysql.Position) error

WaitMasterPos is part of the MysqlDaemon interface

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