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