Documentation ¶
Overview ¶
Copyright 2021 SANGFOR TECHNOLOGIES
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type TestDB
- func (t TestDB) BaseInfo() string
- func (t TestDB) CanReplicateFrom(first dtstruct.InstanceAdaptor, other dtstruct.InstanceAdaptor) (bool, error)
- func (t TestDB) CascadeInfo() string
- func (t TestDB) CategorizeReplication(recovery *dtstruct.TopologyRecovery, key *dtstruct.InstanceKey, ...) (...)
- func (t TestDB) ChangeMasterTo(key *dtstruct.InstanceKey, key2 *dtstruct.InstanceKey, ...) (dtstruct.InstanceAdaptor, error)
- func (t TestDB) CheckIfWouldBeMaster(handler dtstruct.InstanceAdaptor) bool
- func (t TestDB) CliCmd(commandMap map[string]dtstruct.CommandDesc, cliParam *dtstruct.CliParam)
- func (t TestDB) DelayReplication(instanceKey *dtstruct.InstanceKey, seconds int) error
- func (t TestDB) DetachMaster(key *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
- func (t TestDB) DriveName() string
- func (t TestDB) EmptyCommitInstance(instanceKey *dtstruct.InstanceKey) error
- func (t TestDB) ExecSQLOnInstance(instanceKey *dtstruct.InstanceKey, query string, args ...interface{}) (sql.Result, error)
- func (t TestDB) FailOver(instanceKey *dtstruct.InstanceKey) (string, error)
- func (t TestDB) ForgetInstance(instanceKey *dtstruct.InstanceKey) error
- func (t TestDB) GetCandidateReplica(key *dtstruct.InstanceKey, b bool) (dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, ...)
- func (t TestDB) GetCheckAndRecoverFunction(analysisCode dtstruct.AnalysisCode, analyzedInstanceKey *dtstruct.InstanceKey) (...)
- func (t TestDB) GetDBConnPool(uri string) (*sql.DB, error)
- func (t TestDB) GetDBURI(host string, port int, args ...interface{}) string
- func (t TestDB) GetInfoFromInstance(ctx context.Context, instanceKey *dtstruct.InstanceKey, ...) (inst dtstruct.InstanceAdaptor, err error)
- func (t TestDB) GetMasterRecoveryType(analysis *dtstruct.ReplicationAnalysis) dtstruct.RecoveryType
- func (t TestDB) GetReplicationAnalysis(clusterName, clusterId string, hints *dtstruct.ReplicationAnalysisHints) ([]dtstruct.ReplicationAnalysis, error)
- func (t TestDB) GetSyncInfo(instanceKey *dtstruct.InstanceKey, bufferWrites bool, agent string) (interface{}, error)
- func (t TestDB) GracefulMasterTakeover(clusterName string, designatedKey *dtstruct.InstanceKey, auto bool) (topologyRecovery *dtstruct.TopologyRecovery, ...)
- func (t TestDB) IsSmallerBinlogFormat(binlogFormat string, otherBinlogFormat string) bool
- func (t TestDB) KillQuery(instanceKey *dtstruct.InstanceKey, process int64) (dtstruct.InstanceAdaptor, error)
- func (t TestDB) MakeCoMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
- func (t TestDB) MakeLocalMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
- func (t TestDB) MakeMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
- func (t TestDB) MasterInfo() string
- func (t TestDB) MatchBelow(instanceKey, otherKey *dtstruct.InstanceKey, requireInstanceMaintenance bool) (dtstruct.InstanceAdaptor, *dtstruct.LogCoordinates, error)
- func (t TestDB) MatchUp(instanceKey *dtstruct.InstanceKey, requireInstanceMaintenance bool) (dtstruct.InstanceAdaptor, *dtstruct.LogCoordinates, error)
- func (t TestDB) MatchUpReplicas(masterKey *dtstruct.InstanceKey, pattern string) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)
- func (t TestDB) MoveBelow(instanceKey, siblingKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
- func (t TestDB) MoveEquivalent(instanceKey, otherKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
- func (t TestDB) MoveUp(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
- func (t TestDB) MoveUpReplicas(instanceKey *dtstruct.InstanceKey, pattern string) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)
- func (t TestDB) MultiMatchBelow(replicas []dtstruct.InstanceAdaptor, belowKey *dtstruct.InstanceKey, ...) (matchedReplicas []dtstruct.InstanceAdaptor, ...)
- func (t TestDB) MultiMatchReplicas(masterKey *dtstruct.InstanceKey, belowKey *dtstruct.InstanceKey, ...) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)
- func (t TestDB) OpenTopology(host string, port int, args ...interface{}) (*sql.DB, error)
- func (t TestDB) ReadClusterInstances(clusterName string) ([]dtstruct.InstanceAdaptor, error)
- func (t TestDB) ReadFromBackendDB(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, bool, error)
- func (t TestDB) ReadInstanceByCondition(query string, condition string, args []interface{}, sort string) (instanceList []dtstruct.InstanceAdaptor, err error)
- func (t TestDB) ReadReplicaInstances(masterKey *dtstruct.InstanceKey) ([]dtstruct.InstanceAdaptor, error)
- func (t TestDB) ReattachMaster(key *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
- func (t TestDB) RegisterAPIRequest() map[string][]interface{}
- func (t TestDB) RegisterWebRequest() map[string][]interface{}
- func (t TestDB) RegroupReplicas(masterKey *dtstruct.InstanceKey, returnReplicaEvenOnFailureToRegroup bool, ...) (aheadReplicas []dtstruct.InstanceAdaptor, ...)
- func (t TestDB) RelocateBelow(downstreamInstKey, upstreamInstKey *dtstruct.InstanceKey) (interface{}, error)
- func (t TestDB) RelocateReplicas(instanceKey, otherKey *dtstruct.InstanceKey, pattern string) (replicas []dtstruct.InstanceAdaptor, other dtstruct.InstanceAdaptor, err error, ...)
- func (t TestDB) RematchReplica(instanceKey *dtstruct.InstanceKey, requireInstanceMaintenance bool) (dtstruct.InstanceAdaptor, *dtstruct.LogCoordinates, error)
- func (t TestDB) ReplicationConfirm(failedKey *dtstruct.InstanceKey, streamKey *dtstruct.InstanceKey, ...) bool
- func (t TestDB) Repoint(key *dtstruct.InstanceKey, key2 *dtstruct.InstanceKey, s string) (dtstruct.InstanceAdaptor, error)
- func (t TestDB) RepointReplicasTo(instanceKey *dtstruct.InstanceKey, pattern string, ...) ([]dtstruct.InstanceAdaptor, error, []error)
- func (t TestDB) ResetReplication(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
- func (t TestDB) RestartReplication(instanceKey *dtstruct.InstanceKey) (interface{}, error)
- func (t TestDB) RowToInstance(rowMap sqlutil.RowMap) dtstruct.InstanceAdaptor
- func (t TestDB) RunAsCascade(instanceKey *dtstruct.InstanceKey) (string, error)
- func (t TestDB) RunAsMaster(instanceKey *dtstruct.InstanceKey) (string, error)
- func (t TestDB) RunEmergentOperations(analysisEntry *dtstruct.ReplicationAnalysis)
- func (t TestDB) SQLProblemArgs(args ...interface{}) []interface{}
- func (t TestDB) SQLProblemCondition() string
- func (t TestDB) SQLProblemQuery() string
- func (t TestDB) ScanInstanceRow(instanceKey *dtstruct.InstanceKey, query string, dest ...interface{}) error
- func (t TestDB) SchemaBase() []string
- func (t TestDB) SchemaPatch() []string
- func (t TestDB) SetReadOnly(instanceKey *dtstruct.InstanceKey, readOnly bool) (dtstruct.InstanceAdaptor, error)
- func (t TestDB) SetSemiSyncOnDownstream(instanceKey *dtstruct.InstanceKey, enableReplica bool) (dtstruct.InstanceAdaptor, error)
- func (t TestDB) SetSemiSyncOnUpstream(instanceKey *dtstruct.InstanceKey, enableMaster bool) (dtstruct.InstanceAdaptor, error)
- func (t TestDB) SkipQuery(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
- func (t TestDB) SlaveInfo() string
- func (t TestDB) StartReplication(ctx context.Context, instanceKey *dtstruct.InstanceKey) (interface{}, error)
- func (t TestDB) StopReplication(instanceKey *dtstruct.InstanceKey) (interface{}, error)
- func (t TestDB) StopReplicationNicely(instanceKey *dtstruct.InstanceKey, timeout time.Duration) (dtstruct.InstanceAdaptor, error)
- func (t TestDB) TLSCheck(s string) bool
- func (t TestDB) TLSConfig(config *tls.Config) error
- func (t TestDB) TakeMaster(instanceKey *dtstruct.InstanceKey, allowTakingCoMaster bool) (dtstruct.InstanceAdaptor, error)
- func (t TestDB) TakeSiblings(instanceKey *dtstruct.InstanceKey) (instance dtstruct.InstanceAdaptor, takenSiblings int, err error)
- func (t TestDB) Topology(request *dtstruct.Request, historyTimestampPattern string, tabulated bool, ...) (result interface{}, err error)
- func (t TestDB) WriteToBackendDB(ctx context.Context, adaptors []dtstruct.InstanceAdaptor, b bool, b2 bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestDB ¶
type TestDB struct { }
func (TestDB) CanReplicateFrom ¶
func (t TestDB) CanReplicateFrom(first dtstruct.InstanceAdaptor, other dtstruct.InstanceAdaptor) (bool, error)
func (TestDB) CascadeInfo ¶
func (TestDB) CategorizeReplication ¶
func (t TestDB) CategorizeReplication(recovery *dtstruct.TopologyRecovery, key *dtstruct.InstanceKey, f func(dtstruct.InstanceAdaptor, bool) bool) (aheadReplicas, equalReplicas, laterReplicas, cannotReplicateReplicas []dtstruct.InstanceAdaptor, promotedReplica dtstruct.InstanceAdaptor, err error)
func (TestDB) ChangeMasterTo ¶
func (t TestDB) ChangeMasterTo(key *dtstruct.InstanceKey, key2 *dtstruct.InstanceKey, coordinates *dtstruct.LogCoordinates, b bool, s string) (dtstruct.InstanceAdaptor, error)
func (TestDB) CheckIfWouldBeMaster ¶
func (t TestDB) CheckIfWouldBeMaster(handler dtstruct.InstanceAdaptor) bool
func (TestDB) DelayReplication ¶
func (t TestDB) DelayReplication(instanceKey *dtstruct.InstanceKey, seconds int) error
func (TestDB) DetachMaster ¶
func (t TestDB) DetachMaster(key *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
func (TestDB) EmptyCommitInstance ¶
func (t TestDB) EmptyCommitInstance(instanceKey *dtstruct.InstanceKey) error
func (TestDB) ExecSQLOnInstance ¶
func (TestDB) FailOver ¶
func (t TestDB) FailOver(instanceKey *dtstruct.InstanceKey) (string, error)
func (TestDB) ForgetInstance ¶
func (t TestDB) ForgetInstance(instanceKey *dtstruct.InstanceKey) error
func (TestDB) GetCandidateReplica ¶
func (t TestDB) GetCandidateReplica(key *dtstruct.InstanceKey, b bool) (dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, error)
func (TestDB) GetCheckAndRecoverFunction ¶
func (t TestDB) GetCheckAndRecoverFunction(analysisCode dtstruct.AnalysisCode, analyzedInstanceKey *dtstruct.InstanceKey) (checkAndRecoverFunction func(analysisEntry dtstruct.ReplicationAnalysis, candidateInstanceKey *dtstruct.InstanceKey, forceInstanceRecovery bool, skipProcesses bool) (recoveryAttempted bool, topologyRecovery *dtstruct.TopologyRecovery, err error), isActionableRecovery bool)
func (TestDB) GetInfoFromInstance ¶
func (t TestDB) GetInfoFromInstance(ctx context.Context, instanceKey *dtstruct.InstanceKey, checkOnly, bufferWrites bool, latency *stopwatch.NamedStopwatch, agent string) (inst dtstruct.InstanceAdaptor, err error)
func (TestDB) GetMasterRecoveryType ¶
func (t TestDB) GetMasterRecoveryType(analysis *dtstruct.ReplicationAnalysis) dtstruct.RecoveryType
func (TestDB) GetReplicationAnalysis ¶
func (t TestDB) GetReplicationAnalysis(clusterName, clusterId string, hints *dtstruct.ReplicationAnalysisHints) ([]dtstruct.ReplicationAnalysis, error)
func (TestDB) GetSyncInfo ¶
func (TestDB) GracefulMasterTakeover ¶
func (t TestDB) GracefulMasterTakeover(clusterName string, designatedKey *dtstruct.InstanceKey, auto bool) (topologyRecovery *dtstruct.TopologyRecovery, promotedMasterCoordinates *dtstruct.LogCoordinates, err error)
func (TestDB) IsSmallerBinlogFormat ¶
func (TestDB) KillQuery ¶
func (t TestDB) KillQuery(instanceKey *dtstruct.InstanceKey, process int64) (dtstruct.InstanceAdaptor, error)
func (TestDB) MakeCoMaster ¶
func (t TestDB) MakeCoMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
func (TestDB) MakeLocalMaster ¶
func (t TestDB) MakeLocalMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
func (TestDB) MakeMaster ¶
func (t TestDB) MakeMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
func (TestDB) MasterInfo ¶
func (TestDB) MatchBelow ¶
func (t TestDB) MatchBelow(instanceKey, otherKey *dtstruct.InstanceKey, requireInstanceMaintenance bool) (dtstruct.InstanceAdaptor, *dtstruct.LogCoordinates, error)
func (TestDB) MatchUp ¶
func (t TestDB) MatchUp(instanceKey *dtstruct.InstanceKey, requireInstanceMaintenance bool) (dtstruct.InstanceAdaptor, *dtstruct.LogCoordinates, error)
func (TestDB) MatchUpReplicas ¶
func (t TestDB) MatchUpReplicas(masterKey *dtstruct.InstanceKey, pattern string) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)
func (TestDB) MoveBelow ¶
func (t TestDB) MoveBelow(instanceKey, siblingKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
func (TestDB) MoveEquivalent ¶
func (t TestDB) MoveEquivalent(instanceKey, otherKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
func (TestDB) MoveUp ¶
func (t TestDB) MoveUp(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
func (TestDB) MoveUpReplicas ¶
func (t TestDB) MoveUpReplicas(instanceKey *dtstruct.InstanceKey, pattern string) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)
func (TestDB) MultiMatchBelow ¶
func (t TestDB) MultiMatchBelow(replicas []dtstruct.InstanceAdaptor, belowKey *dtstruct.InstanceKey, postponedFunctionsContainer *dtstruct.PostponedFunctionsContainer) (matchedReplicas []dtstruct.InstanceAdaptor, belowInstance dtstruct.InstanceAdaptor, err error, errs []error)
func (TestDB) MultiMatchReplicas ¶
func (t TestDB) MultiMatchReplicas(masterKey *dtstruct.InstanceKey, belowKey *dtstruct.InstanceKey, pattern string) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)
func (TestDB) OpenTopology ¶
func (TestDB) ReadClusterInstances ¶
func (t TestDB) ReadClusterInstances(clusterName string) ([]dtstruct.InstanceAdaptor, error)
func (TestDB) ReadFromBackendDB ¶
func (t TestDB) ReadFromBackendDB(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, bool, error)
func (TestDB) ReadInstanceByCondition ¶
func (TestDB) ReadReplicaInstances ¶
func (t TestDB) ReadReplicaInstances(masterKey *dtstruct.InstanceKey) ([]dtstruct.InstanceAdaptor, error)
func (TestDB) ReattachMaster ¶
func (t TestDB) ReattachMaster(key *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
func (TestDB) RegisterAPIRequest ¶
func (TestDB) RegisterWebRequest ¶
func (TestDB) RegroupReplicas ¶
func (t TestDB) RegroupReplicas(masterKey *dtstruct.InstanceKey, returnReplicaEvenOnFailureToRegroup bool, onCandidateReplicaChosen func(dtstruct.InstanceAdaptor), postponedFunctionsContainer *dtstruct.PostponedFunctionsContainer) (aheadReplicas []dtstruct.InstanceAdaptor, equalReplicas []dtstruct.InstanceAdaptor, laterReplicas []dtstruct.InstanceAdaptor, cannotReplicateReplicas []dtstruct.InstanceAdaptor, instance dtstruct.InstanceAdaptor, err error)
func (TestDB) RelocateBelow ¶
func (t TestDB) RelocateBelow(downstreamInstKey, upstreamInstKey *dtstruct.InstanceKey) (interface{}, error)
func (TestDB) RelocateReplicas ¶
func (t TestDB) RelocateReplicas(instanceKey, otherKey *dtstruct.InstanceKey, pattern string) (replicas []dtstruct.InstanceAdaptor, other dtstruct.InstanceAdaptor, err error, errs []error)
func (TestDB) RematchReplica ¶
func (t TestDB) RematchReplica(instanceKey *dtstruct.InstanceKey, requireInstanceMaintenance bool) (dtstruct.InstanceAdaptor, *dtstruct.LogCoordinates, error)
func (TestDB) ReplicationConfirm ¶
func (t TestDB) ReplicationConfirm(failedKey *dtstruct.InstanceKey, streamKey *dtstruct.InstanceKey, upstream bool) bool
func (TestDB) Repoint ¶
func (t TestDB) Repoint(key *dtstruct.InstanceKey, key2 *dtstruct.InstanceKey, s string) (dtstruct.InstanceAdaptor, error)
func (TestDB) RepointReplicasTo ¶
func (t TestDB) RepointReplicasTo(instanceKey *dtstruct.InstanceKey, pattern string, belowKey *dtstruct.InstanceKey) ([]dtstruct.InstanceAdaptor, error, []error)
func (TestDB) ResetReplication ¶
func (t TestDB) ResetReplication(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
func (TestDB) RestartReplication ¶
func (t TestDB) RestartReplication(instanceKey *dtstruct.InstanceKey) (interface{}, error)
func (TestDB) RowToInstance ¶
func (t TestDB) RowToInstance(rowMap sqlutil.RowMap) dtstruct.InstanceAdaptor
func (TestDB) RunAsCascade ¶
func (t TestDB) RunAsCascade(instanceKey *dtstruct.InstanceKey) (string, error)
func (TestDB) RunAsMaster ¶
func (t TestDB) RunAsMaster(instanceKey *dtstruct.InstanceKey) (string, error)
func (TestDB) RunEmergentOperations ¶
func (t TestDB) RunEmergentOperations(analysisEntry *dtstruct.ReplicationAnalysis)
func (TestDB) SQLProblemArgs ¶
func (t TestDB) SQLProblemArgs(args ...interface{}) []interface{}
func (TestDB) SQLProblemCondition ¶
func (TestDB) SQLProblemQuery ¶
func (TestDB) ScanInstanceRow ¶
func (t TestDB) ScanInstanceRow(instanceKey *dtstruct.InstanceKey, query string, dest ...interface{}) error
func (TestDB) SchemaBase ¶
func (TestDB) SchemaPatch ¶
func (TestDB) SetReadOnly ¶
func (t TestDB) SetReadOnly(instanceKey *dtstruct.InstanceKey, readOnly bool) (dtstruct.InstanceAdaptor, error)
func (TestDB) SetSemiSyncOnDownstream ¶
func (t TestDB) SetSemiSyncOnDownstream(instanceKey *dtstruct.InstanceKey, enableReplica bool) (dtstruct.InstanceAdaptor, error)
func (TestDB) SetSemiSyncOnUpstream ¶
func (t TestDB) SetSemiSyncOnUpstream(instanceKey *dtstruct.InstanceKey, enableMaster bool) (dtstruct.InstanceAdaptor, error)
func (TestDB) SkipQuery ¶
func (t TestDB) SkipQuery(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
func (TestDB) StartReplication ¶
func (TestDB) StopReplication ¶
func (t TestDB) StopReplication(instanceKey *dtstruct.InstanceKey) (interface{}, error)
func (TestDB) StopReplicationNicely ¶
func (t TestDB) StopReplicationNicely(instanceKey *dtstruct.InstanceKey, timeout time.Duration) (dtstruct.InstanceAdaptor, error)
func (TestDB) TakeMaster ¶
func (t TestDB) TakeMaster(instanceKey *dtstruct.InstanceKey, allowTakingCoMaster bool) (dtstruct.InstanceAdaptor, error)
func (TestDB) TakeSiblings ¶
func (t TestDB) TakeSiblings(instanceKey *dtstruct.InstanceKey) (instance dtstruct.InstanceAdaptor, takenSiblings int, err error)
func (TestDB) WriteToBackendDB ¶
Click to show internal directories.
Click to hide internal directories.