Documentation ¶
Index ¶
- type MockDBSourceData
- type MockImportSource
- type MockSourceFile
- type MockTableInfo
- type MockTableSourceData
- type MockTargetInfo
- func (t *MockTargetInfo) CheckVersionRequirements(ctx context.Context) error
- func (t *MockTargetInfo) FetchRemoteTableModels(ctx context.Context, schemaName string) ([]*model.TableInfo, error)
- func (t *MockTargetInfo) GetEmptyRegionsInfo(ctx context.Context) (*pdtypes.RegionsInfo, error)
- func (t *MockTargetInfo) GetReplicationConfig(ctx context.Context) (*pdtypes.ReplicationConfig, error)
- func (t *MockTargetInfo) GetStorageInfo(ctx context.Context) (*pdtypes.StoresInfo, error)
- func (t *MockTargetInfo) GetTargetSysVariablesForImport(ctx context.Context, _ ...ropts.GetPreInfoOption) map[string]string
- func (t *MockTargetInfo) IsTableEmpty(ctx context.Context, schemaName string, tableName string) (*bool, error)
- func (t *MockTargetInfo) SetSysVar(key string, value string)
- func (t *MockTargetInfo) SetTableInfo(schemaName string, tableName string, tblInfo *MockTableInfo)
- type StorageInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockDBSourceData ¶
type MockDBSourceData struct { Name string Tables map[string]*MockTableSourceData }
MockDBSourceData defines a mock source information for a database.
type MockImportSource ¶
type MockImportSource struct {
// contains filtered or unexported fields
}
MockImportSource defines a mock import source
func NewMockImportSource ¶
func NewMockImportSource(dbSrcDataMap map[string]*MockDBSourceData) (*MockImportSource, error)
NewMockImportSource creates a MockImportSource object.
func (*MockImportSource) GetAllDBFileMetas ¶
func (m *MockImportSource) GetAllDBFileMetas() []*mydump.MDDatabaseMeta
GetAllDBFileMetas gets all the Mydumper database metadatas on the mock source.
func (*MockImportSource) GetDBMetaMap ¶
func (m *MockImportSource) GetDBMetaMap() map[string]*mydump.MDDatabaseMeta
GetDBMetaMap gets the Mydumper database metadata map on the mock source.
func (*MockImportSource) GetStorage ¶
func (m *MockImportSource) GetStorage() storage.ExternalStorage
GetStorage gets the External Storage object on the mock source.
type MockSourceFile ¶
MockSourceFile defines a mock source file.
type MockTableInfo ¶
MockTableInfo defines a mock table structure information for a mock target.
type MockTableSourceData ¶
type MockTableSourceData struct { DBName string TableName string SchemaFile *MockSourceFile DataFiles []*MockSourceFile }
MockTableSourceData defines a mock source information for a table.
type MockTargetInfo ¶
type MockTargetInfo struct { MaxReplicasPerRegion int EmptyRegionCountMap map[uint64]int StorageInfos []StorageInfo // contains filtered or unexported fields }
MockTableInfo defines a mock target information.
func NewMockTargetInfo ¶
func NewMockTargetInfo() *MockTargetInfo
NewMockTargetInfo creates a MockTargetInfo object.
func (*MockTargetInfo) CheckVersionRequirements ¶
func (t *MockTargetInfo) CheckVersionRequirements(ctx context.Context) error
CheckVersionRequirements performs the check whether the target satisfies the version requirements. It implements the TargetInfoGetter interface.
func (*MockTargetInfo) FetchRemoteTableModels ¶
func (t *MockTargetInfo) FetchRemoteTableModels(ctx context.Context, schemaName string) ([]*model.TableInfo, error)
FetchRemoteTableModels fetches the table structures from the remote target. It implements the TargetInfoGetter interface.
func (*MockTargetInfo) GetEmptyRegionsInfo ¶
func (t *MockTargetInfo) GetEmptyRegionsInfo(ctx context.Context) (*pdtypes.RegionsInfo, error)
GetEmptyRegionsInfo gets the region information of all the empty regions on the target. It implements the TargetInfoGetter interface.
func (*MockTargetInfo) GetReplicationConfig ¶
func (t *MockTargetInfo) GetReplicationConfig(ctx context.Context) (*pdtypes.ReplicationConfig, error)
GetReplicationConfig gets the replication config on the target. It implements the TargetInfoGetter interface.
func (*MockTargetInfo) GetStorageInfo ¶
func (t *MockTargetInfo) GetStorageInfo(ctx context.Context) (*pdtypes.StoresInfo, error)
GetStorageInfo gets the storage information on the target. It implements the TargetInfoGetter interface.
func (*MockTargetInfo) GetTargetSysVariablesForImport ¶
func (t *MockTargetInfo) GetTargetSysVariablesForImport(ctx context.Context, _ ...ropts.GetPreInfoOption) map[string]string
GetTargetSysVariablesForImport gets some important systam variables for importing on the target. It implements the TargetInfoGetter interface.
func (*MockTargetInfo) IsTableEmpty ¶
func (t *MockTargetInfo) IsTableEmpty(ctx context.Context, schemaName string, tableName string) (*bool, error)
IsTableEmpty checks whether the specified table on the target DB contains data or not. It implements the TargetInfoGetter interface.
func (*MockTargetInfo) SetSysVar ¶
func (t *MockTargetInfo) SetSysVar(key string, value string)
SetSysVar sets the system variables of the mock target.
func (*MockTargetInfo) SetTableInfo ¶
func (t *MockTargetInfo) SetTableInfo(schemaName string, tableName string, tblInfo *MockTableInfo)
SetTableInfo sets the table structure information of the mock target.