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: 16 Imported by: 0

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 Mysql

type Mysql struct {
}

func (*Mysql) BaseInfo

func (m *Mysql) BaseInfo() string

func (*Mysql) CanReplicateFrom

func (m *Mysql) CanReplicateFrom(first dtstruct.InstanceAdaptor, other dtstruct.InstanceAdaptor) (bool, error)

func (*Mysql) CascadeInfo

func (m *Mysql) CascadeInfo() string

func (*Mysql) CategorizeReplication

func (m *Mysql) CategorizeReplication(topologyRecovery *dtstruct.TopologyRecovery, failedInstanceKey *dtstruct.InstanceKey, promotedRepIsIdeal func(dtstruct.InstanceAdaptor, bool) bool) ([]dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error)

func (*Mysql) ChangeMasterTo

func (m *Mysql) ChangeMasterTo(instanceKey *dtstruct.InstanceKey, masterKey *dtstruct.InstanceKey, masterBinlogCoordinates *dtstruct.LogCoordinates, skipUnresolve bool, gtidHint string) (dtstruct.InstanceAdaptor, error)

func (*Mysql) CheckAndRecoverDeadMaster

func (m *Mysql) CheckAndRecoverDeadMaster(analysisEntry dtstruct.ReplicationAnalysis, candidateInstanceKey *dtstruct.InstanceKey, forceInstanceRecovery bool, skipProcesses bool) (recoveryAttempted bool, topologyRecovery *dtstruct.TopologyRecovery, err error)

func (*Mysql) CheckIfWouldBeMaster

func (m *Mysql) CheckIfWouldBeMaster(instance dtstruct.InstanceAdaptor) bool

func (*Mysql) CliCmd

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

func (*Mysql) DelayReplication

func (m *Mysql) DelayReplication(instanceKey *dtstruct.InstanceKey, seconds int) error

func (*Mysql) DetachMaster

func (m *Mysql) DetachMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)

DetachMaster detaches a replica from its master by corrupting the Master_Host (in such way that is reversible)

func (*Mysql) DriveName

func (m *Mysql) DriveName() string

func (*Mysql) EmptyCommitInstance

func (m *Mysql) EmptyCommitInstance(instanceKey *dtstruct.InstanceKey) error

func (*Mysql) ExecSQLOnInstance

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

func (*Mysql) ForgetInstance

func (m *Mysql) ForgetInstance(instanceKey *dtstruct.InstanceKey) error

func (*Mysql) GetCheckAndRecoverFunction

func (m *Mysql) 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 (*Mysql) GetDBConnPool

func (m *Mysql) GetDBConnPool(uri string) (db *sql.DB, err error)

func (*Mysql) GetDBURI

func (m *Mysql) GetDBURI(host string, port int, args ...interface{}) string

func (*Mysql) GetInfoFromInstance

func (m *Mysql) GetInfoFromInstance(ctx context.Context, instanceKey *dtstruct.InstanceKey, checkOnly, bufferWrites bool, latency *stopwatch.NamedStopwatch, agent string) (inst dtstruct.InstanceAdaptor, err error)

func (*Mysql) GetMasterRecoveryType

func (m *Mysql) GetMasterRecoveryType(analysis *dtstruct.ReplicationAnalysis) dtstruct.RecoveryType

func (*Mysql) GetReplicationAnalysis

func (m *Mysql) GetReplicationAnalysis(clusterName, clusterId string, hints *dtstruct.ReplicationAnalysisHints) ([]dtstruct.ReplicationAnalysis, error)

func (*Mysql) GetSyncInfo

func (m *Mysql) GetSyncInfo(instanceKey *dtstruct.InstanceKey, bufferWrites bool, agent string) (interface{}, error)

func (*Mysql) GracefulMasterTakeover

func (m *Mysql) GracefulMasterTakeover(clusterName string, designatedKey *dtstruct.InstanceKey, auto bool) (topologyRecovery *dtstruct.TopologyRecovery, promotedMasterCoordinates *dtstruct.LogCoordinates, err error)

func (*Mysql) IsSmallerBinlogFormat

func (m *Mysql) IsSmallerBinlogFormat(binlogFormat string, otherBinlogFormat string) bool

func (*Mysql) KillQuery

func (m *Mysql) KillQuery(instanceKey *dtstruct.InstanceKey, process int64) (dtstruct.InstanceAdaptor, error)

func (*Mysql) MakeCoMaster

func (m *Mysql) MakeCoMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)

func (*Mysql) MakeLocalMaster

func (m *Mysql) MakeLocalMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)

func (*Mysql) MakeMaster

func (m *Mysql) MakeMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)

func (*Mysql) MasterInfo

func (m *Mysql) MasterInfo() string

func (*Mysql) MatchBelow

func (m *Mysql) MatchBelow(instanceKey, otherKey *dtstruct.InstanceKey, requireInstanceMaintenance bool) (dtstruct.InstanceAdaptor, *dtstruct.LogCoordinates, error)

func (*Mysql) MatchUp

func (m *Mysql) MatchUp(instanceKey *dtstruct.InstanceKey, requireInstanceMaintenance bool) (dtstruct.InstanceAdaptor, *dtstruct.LogCoordinates, error)

func (*Mysql) MatchUpReplicas

func (m *Mysql) MatchUpReplicas(masterKey *dtstruct.InstanceKey, pattern string) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)

func (*Mysql) MoveBelow

func (m *Mysql) MoveBelow(instanceKey, siblingKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)

func (*Mysql) MoveEquivalent

func (m *Mysql) MoveEquivalent(instanceKey, otherKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)

func (*Mysql) MoveUp

func (m *Mysql) MoveUp(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)

func (*Mysql) MoveUpReplicas

func (m *Mysql) MoveUpReplicas(instanceKey *dtstruct.InstanceKey, pattern string) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)

func (*Mysql) MultiMatchBelow

func (m *Mysql) MultiMatchBelow(replicas []dtstruct.InstanceAdaptor, belowKey *dtstruct.InstanceKey, postponedFunctionsContainer *dtstruct.PostponedFunctionsContainer) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)

func (*Mysql) MultiMatchReplicas

func (m *Mysql) MultiMatchReplicas(masterKey *dtstruct.InstanceKey, belowKey *dtstruct.InstanceKey, pattern string) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)

func (*Mysql) OpenTopology

func (m *Mysql) OpenTopology(host string, port int, args ...interface{}) (*sql.DB, error)

func (*Mysql) ReadClusterInstances

func (m *Mysql) ReadClusterInstances(clusterName string) ([]dtstruct.InstanceAdaptor, error)

func (*Mysql) ReadFromBackendDB

func (m *Mysql) ReadFromBackendDB(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, bool, error)

func (*Mysql) ReadInstanceByCondition

func (m *Mysql) ReadInstanceByCondition(query string, condition string, args []interface{}, sort string) ([]dtstruct.InstanceAdaptor, error)

func (*Mysql) ReadReplicaInstances

func (m *Mysql) ReadReplicaInstances(masterKey *dtstruct.InstanceKey) ([]dtstruct.InstanceAdaptor, error)

func (*Mysql) ReattachMaster

func (m *Mysql) ReattachMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)

ReattachMaster reattaches a replica back onto its master by undoing a DetachMaster operation

func (*Mysql) RegisterAPIRequest

func (m *Mysql) RegisterAPIRequest() map[string][]interface{}

func (*Mysql) RegisterWebRequest

func (m *Mysql) RegisterWebRequest() map[string][]interface{}

func (*Mysql) RegroupReplicas

func (m *Mysql) RegroupReplicas(masterKey *dtstruct.InstanceKey, returnReplicaEvenOnFailureToRegroup bool, onCandidateReplicaChosen func(dtstruct.InstanceAdaptor), postponedFunctionsContainer *dtstruct.PostponedFunctionsContainer) ([]dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error)

func (*Mysql) RelocateBelow

func (m *Mysql) RelocateBelow(instanceKey, otherKey *dtstruct.InstanceKey) (interface{}, error)

func (*Mysql) RelocateReplicas

func (m *Mysql) RelocateReplicas(instanceKey, otherKey *dtstruct.InstanceKey, pattern string) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)

func (*Mysql) RematchReplica

func (m *Mysql) RematchReplica(instanceKey *dtstruct.InstanceKey, requireInstanceMaintenance bool) (dtstruct.InstanceAdaptor, *dtstruct.LogCoordinates, error)

func (*Mysql) ReplicationConfirm

func (m *Mysql) ReplicationConfirm(failedKey *dtstruct.InstanceKey, streamKey *dtstruct.InstanceKey, upstream bool) bool

func (*Mysql) Repoint

func (m *Mysql) Repoint(instanceKey *dtstruct.InstanceKey, masterKey *dtstruct.InstanceKey, gtidHint string) (dtstruct.InstanceAdaptor, error)

func (*Mysql) RepointReplicasTo

func (m *Mysql) RepointReplicasTo(instanceKey *dtstruct.InstanceKey, pattern string, belowKey *dtstruct.InstanceKey) ([]dtstruct.InstanceAdaptor, error, []error)

func (*Mysql) ResetReplication

func (m *Mysql) ResetReplication(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)

func (*Mysql) RestartReplication

func (m *Mysql) RestartReplication(instanceKey *dtstruct.InstanceKey) (interface{}, error)

func (*Mysql) RowToInstance

func (m *Mysql) RowToInstance(rowMap sqlutil.RowMap) dtstruct.InstanceAdaptor

readInstanceRow reads a single instance row from the ham4db backend database.

func (*Mysql) RunEmergentOperations

func (m *Mysql) RunEmergentOperations(analysisEntry *dtstruct.ReplicationAnalysis)

func (*Mysql) SQLProblemArgs

func (m *Mysql) SQLProblemArgs(args ...interface{}) []interface{}

func (*Mysql) SQLProblemCondition

func (m *Mysql) SQLProblemCondition() string

func (*Mysql) SQLProblemQuery

func (m *Mysql) SQLProblemQuery() string

func (*Mysql) ScanInstanceRow

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

func (*Mysql) SchemaBase

func (m *Mysql) SchemaBase() []string

func (*Mysql) SchemaPatch

func (m *Mysql) SchemaPatch() []string

func (*Mysql) SetReadOnly

func (m *Mysql) SetReadOnly(instanceKey *dtstruct.InstanceKey, readOnly bool) (dtstruct.InstanceAdaptor, error)

func (*Mysql) SetSemiSyncOnDownstream

func (m *Mysql) SetSemiSyncOnDownstream(instanceKey *dtstruct.InstanceKey, enableReplica bool) (dtstruct.InstanceAdaptor, error)

func (*Mysql) SetSemiSyncOnUpstream

func (m *Mysql) SetSemiSyncOnUpstream(instanceKey *dtstruct.InstanceKey, enableMaster bool) (dtstruct.InstanceAdaptor, error)

func (*Mysql) SkipQuery

func (m *Mysql) SkipQuery(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)

func (*Mysql) SlaveInfo

func (m *Mysql) SlaveInfo() string

func (*Mysql) StartReplication

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

func (*Mysql) StopReplication

func (m *Mysql) StopReplication(instanceKey *dtstruct.InstanceKey) (interface{}, error)

func (*Mysql) StopReplicationNicely

func (m *Mysql) StopReplicationNicely(instanceKey *dtstruct.InstanceKey, timeout time.Duration) (dtstruct.InstanceAdaptor, error)

func (*Mysql) TLSCheck

func (m *Mysql) TLSCheck(uri string) bool

func (*Mysql) TLSConfig

func (m *Mysql) TLSConfig(tlsConfig *tls.Config) error

func (*Mysql) TakeMaster

func (m *Mysql) TakeMaster(instanceKey *dtstruct.InstanceKey, allowTakingCoMaster bool) (dtstruct.InstanceAdaptor, error)

func (*Mysql) TakeSiblings

func (m *Mysql) TakeSiblings(instanceKey *dtstruct.InstanceKey) (instance dtstruct.InstanceAdaptor, takenSiblings int, err error)

func (*Mysql) Topology

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

func (*Mysql) WriteToBackendDB

func (m2 *Mysql) WriteToBackendDB(ctx context.Context, instances []dtstruct.InstanceAdaptor, instanceWasActuallyFound bool, updateLastSeen bool) error

Jump to

Keyboard shortcuts

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