public class AuroraProtocol extends MastersSlavesProtocol
activeResult, charset, connected, currentHost, database, dataTypeMappingFlags, explicitClosed, hasWarnings, lock, moreResults, packetFetcher, prepareStatementCache, proxy, readOnly, 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)
Initilize new protocol instance.
|
boolean |
isMasterConnection() |
static void |
loop(AuroraListener listener,
List<HostAddress> addresses,
SearchFilter searchFilter)
loop until found the failed connection.
|
static void |
searchProbableMaster(AuroraListener listener,
HostAddress probableMaster,
SearchFilter searchFilter)
Connect aurora probable master.
|
foundMaster, foundSecondary, loop, mustBeMasterConnection, setMustBeMasterConnectionloopcancelCurrentQuery, closeExplicit, closeIfActiveResult, closePreparedStatement, executeBatch, executePreparedQuery, executePreparedQueryAfterFailover, executeQuery, executeQuery, executeQuery, getAutocommit, getMaxRows, getMoreResults, getResult, getTimeout, getTransactionIsolationLevel, hasMoreResults, hasUnreadData, hexdump, hexdump, inTransaction, ping, prepare, prepareStatementCache, releasePrepareStatement, rollback, setCatalog, setInternalMaxRows, setLocalInfileInputStream, setMaxRows, setTimeout, setTransactionIsolationclose, close, connect, connectWithoutProxy, getCalendar, getDatabase, getDataTypeMappingFlags, getHost, getHostAddress, getMajorServerVersion, getMinorServerVersion, getOptions, getPassword, getPinGlobalTxToPhysicalConnection, getPort, getProxy, getReadonly, getServerData, getServerThreadId, getServerVersion, getUrlParser, getUsername, hasWarnings, isClosed, isConnected, isExplicitClosed, noBackslashEscapes, readEofPacket, setHostAddress, setHostFailedWithoutProxy, setProxy, setReadonly, shouldReconnectWithoutProxy, versionGreaterOrEqualclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, connect, connectWithoutProxy, getCalendar, getDatabase, getDataTypeMappingFlags, getHost, getHostAddress, getMajorServerVersion, getMinorServerVersion, getOptions, getPassword, getPinGlobalTxToPhysicalConnection, getPort, getProxy, getReadonly, getServerData, getServerThreadId, getServerVersion, getUrlParser, getUsername, hasWarnings, isClosed, isConnected, isExplicitClosed, noBackslashEscapes, setHostAddress, setHostFailedWithoutProxy, setProxy, setReadonly, shouldReconnectWithoutProxy, versionGreaterOrEqualpublic AuroraProtocol(UrlParser url, ReentrantLock lock)
public static void searchProbableMaster(AuroraListener listener, HostAddress probableMaster, SearchFilter searchFilter) throws QueryException
listener - aurora failover to call back if master is foundprobableMaster - probable master hostsearchFilter - search filterQueryException - exceptionpublic static void loop(AuroraListener listener, List<HostAddress> addresses, SearchFilter searchFilter) throws QueryException
listener - current failoveraddresses - list of HostAddress to loopsearchFilter - search parameterQueryException - if not foundpublic static AuroraProtocol getNewProtocol(FailoverProxy proxy, UrlParser urlParser)
proxy - proxyurlParser - connection string data'spublic boolean isMasterConnection()
isMasterConnection in interface ProtocolisMasterConnection in class AbstractConnectProtocolpublic boolean checkIfMaster()
throws QueryException
checkIfMaster in interface ProtocolcheckIfMaster in class AbstractConnectProtocolQueryExceptionCopyright © 2016. All rights reserved.