public class AuroraProtocol extends MastersReplicasProtocol
masterConnectionactiveStreamingResult, autoIncrementIncrement, CHECK_GALERA_STATE_QUERY, connected, database, eofDeprecated, exceptionFactory, explicitClosed, galeraAllowedStates, hasWarnings, lock, options, proxy, reader, readOnly, serverCapabilities, serverPrepareStatementCache, serverStatus, serverThreadId, socket, socketTimeout, traceCache, urlParser, writer| Constructor and Description |
|---|
AuroraProtocol(UrlParser url,
GlobalStateInfo globalInfo,
java.util.concurrent.locks.ReentrantLock lock,
LruTraceCache traceCache) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkIfMaster()
Aurora best way to check if a node is a master : is not in read-only mode.
|
static AuroraProtocol |
getNewProtocol(FailoverProxy proxy,
GlobalStateInfo globalInfo,
UrlParser urlParser)
Initialize new protocol instance.
|
boolean |
isMasterConnection()
Indicate if current protocol is a master protocol.
|
boolean |
isValid(int timeout)
Check that connection is valid.
|
static void |
loop(AuroraListener listener,
GlobalStateInfo globalInfo,
java.util.List<HostAddress> addresses,
SearchFilter initialSearchFilter)
loop until found the failed connection.
|
void |
readPipelineCheckMaster() |
private static void |
resetHostList(AuroraListener listener,
java.util.Deque<HostAddress> loopAddresses)
Reinitialize loopAddresses with all hosts : all servers in randomize order with cluster
address.
|
private static void |
searchProbableMaster(AuroraListener listener,
GlobalStateInfo globalInfo,
HostAddress probableMaster)
Connect aurora probable master.
|
foundMaster, foundSecondary, loop, mustBeMasterConnection, setMustBeMasterConnectionloopcancelCurrentQuery, closeExplicit, executeBatchClient, executeBatchServer, executeBatchStmt, executePreparedQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, forceReleasePrepareStatement, forceReleaseWaitingPrepareStatement, getAutocommit, getAutoIncrementIncrement, getCatalog, getMaxRows, getResult, getTimeout, getTransactionIsolationLevel, handleIoException, interrupt, inTransaction, isInterrupted, ping, prepare, prolog, prologProxy, putInCache, releasePrepareStatement, reset, resetDatabase, resetStateAfterFailover, rollback, setActiveFutureTask, setCatalog, setLocalInfileInputStream, setMaxRows, setReadonly, setTimeout, setTransactionIsolation, stopIfInterruptedabort, changeSocketSoTimeout, changeSocketTcpNoDelay, close, connect, connectWithoutProxy, destroySocket, getActiveStreamingResult, getDatabase, getHost, getHostAddress, getLock, getMajorServerVersion, getMinorServerVersion, getOptions, getPinGlobalTxToPhysicalConnection, getPort, getProxy, getReader, getReadonly, getServerThreadId, getServerVersion, getSocket, getTimeZone, getTraces, getUrlParser, getUsername, hasMoreResults, hasWarnings, isClosed, isConnected, isEofDeprecated, isExplicitClosed, isServerMariaDb, noBackslashEscapes, prepareStatementCache, readEofPacket, removeActiveStreamingResult, removeHasMoreResults, sessionStateAware, setActiveStreamingResult, setHasWarnings, setHostAddress, setHostFailedWithoutProxy, setProxy, setServerStatus, shouldReconnectWithoutProxy, skip, skipEofPacket, versionGreaterOrEqualclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitabort, changeSocketSoTimeout, changeSocketTcpNoDelay, close, connect, connectWithoutProxy, getActiveStreamingResult, getDatabase, getHost, getHostAddress, getLock, getMajorServerVersion, getMinorServerVersion, getOptions, getPinGlobalTxToPhysicalConnection, getPort, getProxy, getReader, getReadonly, getServerThreadId, getServerVersion, getSocket, getTimeZone, getTraces, getUrlParser, getUsername, hasMoreResults, hasWarnings, isClosed, isConnected, isEofDeprecated, isExplicitClosed, isServerMariaDb, noBackslashEscapes, prepareStatementCache, readEofPacket, removeActiveStreamingResult, removeHasMoreResults, sessionStateAware, setActiveStreamingResult, setHasWarnings, setHostAddress, setHostFailedWithoutProxy, setProxy, setServerStatus, shouldReconnectWithoutProxy, skip, skipEofPacket, versionGreaterOrEqualpublic AuroraProtocol(UrlParser url, GlobalStateInfo globalInfo, java.util.concurrent.locks.ReentrantLock lock, LruTraceCache traceCache)
private static void searchProbableMaster(AuroraListener listener, GlobalStateInfo globalInfo, HostAddress probableMaster)
listener - aurora failover to call back if master is foundglobalInfo - server global variables informationprobableMaster - probable master hostpublic static void loop(AuroraListener listener, GlobalStateInfo globalInfo, java.util.List<HostAddress> addresses, SearchFilter initialSearchFilter) throws java.sql.SQLException
listener - current failoverglobalInfo - server global variables informationaddresses - list of HostAddress to loopinitialSearchFilter - search parameterjava.sql.SQLException - if not foundprivate static void resetHostList(AuroraListener listener, java.util.Deque<HostAddress> loopAddresses)
listener - current listenerloopAddresses - the list to reinitializepublic static AuroraProtocol getNewProtocol(FailoverProxy proxy, GlobalStateInfo globalInfo, UrlParser urlParser)
proxy - proxyglobalInfo - server global variables informationurlParser - connection string data'spublic boolean isMasterConnection()
AbstractConnectProtocolisMasterConnection in interface ProtocolisMasterConnection in class AbstractConnectProtocolpublic void readPipelineCheckMaster()
throws java.sql.SQLException
readPipelineCheckMaster in class AbstractConnectProtocoljava.sql.SQLExceptionpublic boolean isValid(int timeout)
throws java.sql.SQLException
AbstractQueryProtocolisValid in interface ProtocolisValid in class AbstractQueryProtocoltimeout - timeout in millisecondsjava.sql.SQLException - if any error occurpublic boolean checkIfMaster()
throws java.sql.SQLException
checkIfMaster in interface ProtocolcheckIfMaster in class AbstractConnectProtocoljava.sql.SQLException - if requesting infos for server fail.