public class AuroraProtocol extends MastersSlavesProtocol
activeResult, charset, connected, currentHost, database, dataTypeMappingFlags, explicitClosed, hasWarnings, lock, moreResultsTypeBinary, 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, setMustBeMasterConnection
loop
cancelCurrentQuery, closeExplicit, closeIfActiveResult, closePreparedStatement, executeMultiQueries, executePreparedQuery, executePreparedQueryAfterFailover, executeQueries, executeQuery, executeQuery, forceReleasePrepareStatement, getAutocommit, getMaxRows, getMoreResults, getResult, getTimeout, getTransactionIsolationLevel, hasUnreadData, hexdump, hexdump, inTransaction, ping, prepare, prepareStatementCache, releasePrepareStatement, rollback, setCatalog, setInternalMaxRows, setLocalInfileInputStream, setMaxRows, setTimeout, setTransactionIsolation
close, close, connect, connectWithoutProxy, getActiveResult, getCalendar, getDatabase, getDataTypeMappingFlags, getHost, getHostAddress, getLock, getMajorServerVersion, getMinorServerVersion, getOptions, getPassword, getPinGlobalTxToPhysicalConnection, getPort, getPrepareStatementCache, getProxy, getReadonly, getServerData, getServerThreadId, getServerVersion, getUrlParser, getUsername, hasMoreResults, hasWarnings, isClosed, isConnected, isExplicitClosed, noBackslashEscapes, readEofPacket, resetMoreResults, setActiveResult, setHasWarnings, setHostAddress, setHostFailedWithoutProxy, setMoreResults, setProxy, setReadonly, shouldReconnectWithoutProxy, skip, versionGreaterOrEqual
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, connect, connectWithoutProxy, getActiveResult, getCalendar, getDatabase, getDataTypeMappingFlags, getHost, getHostAddress, getLock, getMajorServerVersion, getMinorServerVersion, getOptions, getPassword, getPinGlobalTxToPhysicalConnection, getPort, getProxy, getReadonly, getServerData, getServerThreadId, getServerVersion, getUrlParser, getUsername, hasMoreResults, hasWarnings, isClosed, isConnected, isExplicitClosed, noBackslashEscapes, setActiveResult, setHasWarnings, setHostAddress, setHostFailedWithoutProxy, setMoreResults, setProxy, setReadonly, shouldReconnectWithoutProxy, skip, versionGreaterOrEqual
public 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 Protocol
isMasterConnection
in class AbstractConnectProtocol
public boolean checkIfMaster() throws QueryException
checkIfMaster
in interface Protocol
checkIfMaster
in class AbstractConnectProtocol
QueryException
Copyright © 2016. All rights reserved.