public class AuroraProtocol extends MastersSlavesProtocol
masterConnection
readScheduler
activeStreamingResult, autoIncrementIncrement, connected, database, eofDeprecated, explicitClosed, hasWarnings, lock, options, proxy, reader, readOnly, serverCapabilities, serverPrepareStatementCache, serverStatus, serverThreadId, socket, urlParser, writer
Constructor and Description |
---|
AuroraProtocol(UrlParser url,
ReentrantLock lock) |
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,
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,
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, inTransaction, isInterrupted, ping, prepare, prolog, prologProxy, releasePrepareStatement, resetStateAfterFailover, rollback, setActiveFutureTask, setCatalog, setInternalMaxRows, setLocalInfileInputStream, setMaxRows, setTimeout, setTransactionIsolation, stopIfInterrupted
changeSocketSoTimeout, changeSocketTcpNoDelay, close, connect, connectWithoutProxy, getActiveStreamingResult, getDatabase, getDataTypeMappingFlags, getHost, getHostAddress, getLock, getMajorServerVersion, getMinorServerVersion, getOptions, getPinGlobalTxToPhysicalConnection, getPort, getProxy, getReader, getReadonly, getServerThreadId, getServerVersion, 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
changeSocketSoTimeout, changeSocketTcpNoDelay, close, connect, connectWithoutProxy, getActiveStreamingResult, getDatabase, getDataTypeMappingFlags, getHost, getHostAddress, getLock, getMajorServerVersion, getMinorServerVersion, getOptions, getPinGlobalTxToPhysicalConnection, getPort, getProxy, getReader, getReadonly, getServerThreadId, getServerVersion, 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, ReentrantLock lock)
public static void loop(AuroraListener listener, List<HostAddress> addresses, SearchFilter initialSearchFilter) throws SQLException
listener
- current failoveraddresses
- list of HostAddress to loopinitialSearchFilter
- search parameterSQLException
- if not foundpublic static AuroraProtocol getNewProtocol(FailoverProxy proxy, UrlParser urlParser)
proxy
- proxyurlParser
- 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 © 2017. All rights reserved.