org.mariadb.jdbc.internal.protocol
Class AuroraProtocol
java.lang.Object
org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol
org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol
org.mariadb.jdbc.internal.protocol.MasterProtocol
org.mariadb.jdbc.internal.protocol.MastersSlavesProtocol
org.mariadb.jdbc.internal.protocol.AuroraProtocol
- All Implemented Interfaces:
- Closeable, Protocol
public class AuroraProtocol
- extends MastersSlavesProtocol
Fields inherited from class org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol |
activeStreamingResult, autoIncrementIncrement, connected, currentHost, database, dataTypeMappingFlags, eofDeprecated, explicitClosed, hasWarnings, IS_MASTER_QUERY, lock, options, proxy, reader, readOnly, serverCapabilities, serverPrepareStatementCache, serverStatus, serverThreadId, SESSION_QUERY, socket, urlParser, writer |
Methods inherited from class org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol |
addPrepareInCache, cancelCurrentQuery, closeExplicit, executeBatch, executeBatchMulti, executeBatchMultiple, executeBatchRewrite, executePreparedQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, forceReleasePrepareStatement, forceReleaseWaitingPrepareStatement, getAutocommit, getAutoIncrementIncrement, getMaxRows, getResult, getTimeout, getTransactionIsolationLevel, handleIoException, inTransaction, isInterrupted, ping, prepare, prepareAndExecute, prepareAndExecutes, prolog, prologProxy, readErrorPacket, readLocalInfilePacket, readOkPacket, readPacket, readResultSet, releasePrepareStatement, resetStateAfterFailover, rollback, setActiveFutureTask, setCatalog, setInternalMaxRows, setLocalInfileInputStream, setMaxRows, setTimeout, setTransactionIsolation, stopIfInterrupted |
Methods inherited from class org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol |
changeSocketSoTimeout, changeSocketTcpNoDelay, close, close, connect, connectWithoutProxy, enabledSslCipherSuites, enabledSslProtocolSuites, getActiveStreamingResult, getDatabase, getDataTypeMappingFlags, getHost, getHostAddress, getLock, getMajorServerVersion, getMinorServerVersion, getOptions, getPassword, getPinGlobalTxToPhysicalConnection, getPort, getProxy, getReader, getReadonly, getServerData, getServerThreadId, getServerVersion, getTimeZone, getTraces, getUrlParser, getUsername, getWriter, hasMoreResults, hasWarnings, isClosed, isConnected, isEofDeprecated, isExplicitClosed, isServerMariaDb, noBackslashEscapes, prepareStatementCache, readEofPacket, removeActiveStreamingResult, removeHasMoreResults, sendPipelineCheckMaster, sessionStateAware, setActiveStreamingResult, setHasWarnings, setHostAddress, setHostFailedWithoutProxy, setProxy, setReadonly, setServerStatus, shouldReconnectWithoutProxy, skip, skipEofPacket, versionGreaterOrEqual |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.mariadb.jdbc.internal.protocol.Protocol |
changeSocketSoTimeout, changeSocketTcpNoDelay, close, connect, connectWithoutProxy, getActiveStreamingResult, getDatabase, getDataTypeMappingFlags, getHost, getHostAddress, getLock, getMajorServerVersion, getMinorServerVersion, getOptions, getPassword, 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 |
AuroraProtocol
public AuroraProtocol(UrlParser url,
ReentrantLock lock)
searchProbableMaster
public static void searchProbableMaster(AuroraListener listener,
HostAddress probableMaster)
- Connect aurora probable master.
Aurora master change in time. The only way to check that a server is a master is to asked him.
- Parameters:
listener
- aurora failover to call back if master is foundprobableMaster
- probable master host
loop
public static void loop(AuroraListener listener,
List<HostAddress> addresses,
SearchFilter searchFilter)
throws SQLException
- loop until found the failed connection.
- Parameters:
listener
- current failoveraddresses
- list of HostAddress to loopsearchFilter
- search parameter
- Throws:
SQLException
- if not found
getNewProtocol
public static AuroraProtocol getNewProtocol(FailoverProxy proxy,
UrlParser urlParser)
- Initialize new protocol instance.
- Parameters:
proxy
- proxyurlParser
- connection string data's
- Returns:
- new AuroraProtocol
isMasterConnection
public boolean isMasterConnection()
- Description copied from class:
AbstractConnectProtocol
- Indicate if current protocol is a master protocol.
- Specified by:
isMasterConnection
in interface Protocol
- Overrides:
isMasterConnection
in class AbstractConnectProtocol
- Returns:
- is master flag
readPipelineCheckMaster
public void readPipelineCheckMaster()
throws IOException,
SQLException
- Overrides:
readPipelineCheckMaster
in class AbstractConnectProtocol
- Throws:
IOException
SQLException
isValid
public boolean isValid()
throws SQLException
- Specified by:
isValid
in interface Protocol
- Overrides:
isValid
in class AbstractQueryProtocol
- Throws:
SQLException
checkIfMaster
public boolean checkIfMaster()
throws SQLException
- Aurora best way to check if a node is a master : is not in read-only mode.
- Specified by:
checkIfMaster
in interface Protocol
- Overrides:
checkIfMaster
in class AbstractConnectProtocol
- Returns:
- indicate if master has been found
- Throws:
SQLException
- if requesting infos for server fail.
Copyright © 2017. All rights reserved.