handler

package
v0.0.0-...-6b32d26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 10 Imported by: 2

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestDB

type TestDB struct {
}

func (TestDB) BaseInfo

func (t TestDB) BaseInfo() string

func (TestDB) CanReplicateFrom

func (t TestDB) CanReplicateFrom(first dtstruct.InstanceAdaptor, other dtstruct.InstanceAdaptor) (bool, error)

func (TestDB) CascadeInfo

func (t TestDB) CascadeInfo() string

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) CliCmd

func (t TestDB) CliCmd(commandMap map[string]dtstruct.CommandDesc, cliParam *dtstruct.CliParam)

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) DriveName

func (t TestDB) DriveName() string

func (TestDB) EmptyCommitInstance

func (t TestDB) EmptyCommitInstance(instanceKey *dtstruct.InstanceKey) error

func (TestDB) ExecSQLOnInstance

func (t TestDB) ExecSQLOnInstance(instanceKey *dtstruct.InstanceKey, query string, args ...interface{}) (sql.Result, error)

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) 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) GetDBConnPool

func (t TestDB) GetDBConnPool(uri string) (*sql.DB, error)

func (TestDB) GetDBURI

func (t TestDB) GetDBURI(host string, port int, args ...interface{}) string

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 (t TestDB) GetSyncInfo(instanceKey *dtstruct.InstanceKey, bufferWrites bool, agent string) (interface{}, error)

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 (t TestDB) IsSmallerBinlogFormat(binlogFormat string, otherBinlogFormat string) bool

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 (t TestDB) MasterInfo() string

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 (t TestDB) OpenTopology(host string, port int, args ...interface{}) (*sql.DB, error)

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 (t TestDB) ReadInstanceByCondition(query string, condition string, args []interface{}, sort string) (instanceList []dtstruct.InstanceAdaptor, err error)

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 (t TestDB) RegisterAPIRequest() map[string][]interface{}

func (TestDB) RegisterWebRequest

func (t TestDB) RegisterWebRequest() map[string][]interface{}

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 (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 (t TestDB) SQLProblemCondition() string

func (TestDB) SQLProblemQuery

func (t TestDB) SQLProblemQuery() string

func (TestDB) ScanInstanceRow

func (t TestDB) ScanInstanceRow(instanceKey *dtstruct.InstanceKey, query string, dest ...interface{}) error

func (TestDB) SchemaBase

func (t TestDB) SchemaBase() []string

func (TestDB) SchemaPatch

func (t TestDB) SchemaPatch() []string

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) SlaveInfo

func (t TestDB) SlaveInfo() string

func (TestDB) StartReplication

func (t TestDB) StartReplication(ctx context.Context, instanceKey *dtstruct.InstanceKey) (interface{}, error)

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) TLSCheck

func (t TestDB) TLSCheck(s string) bool

func (TestDB) TLSConfig

func (t TestDB) TLSConfig(config *tls.Config) 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) Topology

func (t TestDB) Topology(request *dtstruct.Request, historyTimestampPattern string, tabulated bool, printTags bool) (result interface{}, err error)

func (TestDB) WriteToBackendDB

func (t TestDB) WriteToBackendDB(ctx context.Context, adaptors []dtstruct.InstanceAdaptor, b bool, b2 bool) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL