public class AuroraProtocol extends MastersSlavesProtocol
masterConnection
activeStreamingResult, 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,
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,
List<HostAddress> addresses,
SearchFilter initialSearchFilter)
loop until found the failed connection.
|
void |
readPipelineCheckMaster() |
foundMaster, foundSecondary, loop, mustBeMasterConnection, setMustBeMasterConnection
loop
addPrepareInCache, cancelCurrentQuery, 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, releasePrepareStatement, reset, resetDatabase, resetStateAfterFailover, rollback, setActiveFutureTask, setCatalog, setLocalInfileInputStream, setMaxRows, setTimeout, setTransactionIsolation, stopIfInterrupted
abort, 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, getWriter, hasMoreResults, hasWarnings, isClosed, isConnected, isEofDeprecated, isExplicitClosed, isServerMariaDb, noBackslashEscapes, prepareStatementCache, readEofPacket, removeActiveStreamingResult, removeHasMoreResults, sessionStateAware, setActiveStreamingResult, setHasWarnings, setHostAddress, setHostFailedWithoutProxy, setProxy, setReadonly, setServerStatus, shouldReconnectWithoutProxy, skip, skipEofPacket, versionGreaterOrEqual
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
abort, 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, getWriter, hasMoreResults, hasWarnings, isClosed, isConnected, isEofDeprecated, isExplicitClosed, isServerMariaDb, noBackslashEscapes, prepareStatementCache, readEofPacket, removeActiveStreamingResult, removeHasMoreResults, sessionStateAware, setActiveStreamingResult, setHasWarnings, setHostAddress, setHostFailedWithoutProxy, setProxy, setReadonly, setServerStatus, shouldReconnectWithoutProxy, skip, skipEofPacket, versionGreaterOrEqual
public AuroraProtocol(UrlParser url, GlobalStateInfo globalInfo, ReentrantLock lock, LruTraceCache traceCache)
public static void loop(AuroraListener listener, GlobalStateInfo globalInfo, List<HostAddress> addresses, SearchFilter initialSearchFilter) throws SQLException
listener
- current failoverglobalInfo
- server global variables informationaddresses
- list of HostAddress to loopinitialSearchFilter
- search parameterSQLException
- if not foundpublic static AuroraProtocol getNewProtocol(FailoverProxy proxy, GlobalStateInfo globalInfo, UrlParser urlParser)
proxy
- proxyglobalInfo
- server global variables informationurlParser
- connection string data'spublic boolean isMasterConnection()
AbstractConnectProtocol
isMasterConnection
in interface Protocol
isMasterConnection
in class AbstractConnectProtocol
public void readPipelineCheckMaster() throws SQLException
readPipelineCheckMaster
in class AbstractConnectProtocol
SQLException
public boolean isValid(int timeout) throws SQLException
AbstractQueryProtocol
isValid
in interface Protocol
isValid
in class AbstractQueryProtocol
timeout
- timeout in millisecondsSQLException
- if any error occurpublic boolean checkIfMaster() throws SQLException
checkIfMaster
in interface Protocol
checkIfMaster
in class AbstractConnectProtocol
SQLException
- if requesting infos for server fail.Copyright © 2020 mariadb.com. All rights reserved.