public abstract class AbstractConnectProtocol extends Object implements Protocol
| 构造器和说明 |
|---|
AbstractConnectProtocol(UrlParser urlParser,
GlobalStateInfo globalInfo,
ReentrantLock lock,
LruTraceCache traceCache)
Get a protocol instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
abort()
Force closes socket and stream readers/writers.
|
void |
changeSocketSoTimeout(int setSoTimeout) |
void |
changeSocketTcpNoDelay(boolean setTcpNoDelay)
Change Socket TcpNoDelay option.
|
boolean |
checkIfMaster()
Check that current connection is a master connection (not read-only).
|
protected void |
cleanMemory() |
void |
close()
Closes socket and stream readers/writers Attempts graceful shutdown.
|
void |
connect()
Connect to currentHost.
|
void |
connectWithoutProxy()
Connect without proxy.
|
void |
destroySocket()
Closing socket in case of Connection error after socket creation.
|
void |
endCallInterface(String message) |
abstract void |
executeQuery(String sql) |
Results |
getActiveStreamingResult() |
HostAddress |
getCurrentHost() |
String |
getDatabase() |
String |
getEncoding() |
String |
getFullLinkTraceAction() |
String |
getFullLinkTraceClientInfo() |
String |
getFullLinkTraceIdentifier() |
byte |
getFullLinkTraceLevel() |
String |
getFullLinkTraceModule() |
double |
getFullLinkTracePrintSamplePercentage() |
byte |
getFullLinkTraceRecordPolicy() |
double |
getFullLinkTraceSamplePercentage() |
long |
getFullLinkTraceSlowQueryThreshold() |
String |
getHost() |
HostAddress |
getHostAddress() |
ReentrantLock |
getLock() |
int |
getMajorServerVersion() |
int |
getMinorServerVersion() |
String |
getObServerVersion() |
Options |
getOptions() |
boolean |
getPinGlobalTxToPhysicalConnection() |
int |
getPort() |
FailoverProxy |
getProxy() |
PacketInputStream |
getReader() |
boolean |
getReadonly() |
int |
getServerStatus() |
long |
getServerThreadId() |
TimeZone |
getServerTimeZone() |
String |
getServerVersion() |
Socket |
getSocket() |
TimeTrace |
getTimeTrace() |
TimeZone |
getTimeZone() |
String |
getTraces()
Get a String containing readable information about last 10 send/received packets.
|
UrlParser |
getUrlParser() |
String |
getUsername() |
PacketOutputStream |
getWriter() |
boolean |
hasMoreResults() |
boolean |
hasWarnings()
Has warnings.
|
boolean |
haveInformationSchemaParameters() |
boolean |
isClosed()
Is the connection closed.
|
boolean |
isConnected()
Is connected.
|
boolean |
isEofDeprecated() |
boolean |
isExplicitClosed() |
boolean |
isMasterConnection()
Indicate if current protocol is a master protocol.
|
boolean |
isOracleMode() |
boolean |
isServerMariaDb() |
boolean |
isTZTablesImported() |
boolean |
mustBeMasterConnection() |
boolean |
noBackslashEscapes() |
void |
parseVersion(String serverVersion) |
protected void |
postConnectionQueries() |
ServerPrepareStatementCache |
prepareStatementCache() |
void |
readEofPacket()
Check that next read packet is a End-of-file packet.
|
void |
readPipelineCheckMaster()
已过时。
|
void |
removeActiveStreamingResult()
Remove exception result and since totally fetched, set fetch size to 0.
|
void |
removeHasMoreResults()
Remove flag has more results.
|
boolean |
sessionStateAware() |
void |
setActiveStreamingResult(Results activeStreamingResult) |
void |
setFullLinkTraceAction(String action) |
void |
setFullLinkTraceClientInfo(String clientInfo) |
void |
setFullLinkTraceIdentifier(String clientIdentifier) |
void |
setFullLinkTraceModule(String module,
String action) |
void |
setHasWarnings(boolean hasWarnings) |
void |
setHostAddress(HostAddress host) |
void |
setHostFailedWithoutProxy() |
void |
setObServerVersion(String version) |
void |
setOracleMode(boolean oracleMode) |
void |
setProxy(FailoverProxy proxy) |
void |
setServerStatus(short serverStatus) |
boolean |
shouldReconnectWithoutProxy()
Indicate for Old reconnection if can reconnect without throwing exception.
|
void |
skip()
Skip packets not read that are not needed.
|
void |
skipEofPacket()
Check that next read packet is a End-of-file packet.
|
void |
startCallInterface() |
boolean |
supportFetchWithOffset() |
boolean |
supportStmtPrepareExecute() |
boolean |
versionGreaterOrEqual(int major,
int minor,
int patch)
Utility method to check if database version is greater than parameters.
|
protected void |
whyConnectedIsFalse() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddPrepareInCache, cancelCurrentQuery, changeUser, clearNetworkStatistics, closeExplicit, executeBatchClient, executeBatchServer, executeBatchStmt, executePreparedQuery, executePreparedQuery, executePreparedQueryArrayBinding, executePreparedQueryArrayBinding, executeQuery, executeQuery, executeQuery, executeQuery, fetchRowViaCursor, fetchRowViaCursorForOracle, forceReleasePrepareStatement, getAutocommit, getAutoIncrementIncrement, getCatalog, getChecksum, getExecuteMode, getIterationCount, getLastPacketCostTime, getLastPacketResponseTimestamp, getLastPacketSendTimestamp, getMaxRows, getNetworkStatisticsFlag, getResult, getTimeout, getTransactionIsolationLevel, handleIoException, interrupt, inTransaction, isInterrupted, isValid, ping, prepare, prolog, prologProxy, readErrorPacket, readOkPacket, readResultSet, releasePrepareStatement, reset, resetChecksum, resetDatabase, resetStateAfterFailover, rollback, setActiveFutureTask, setAutoCommit, setCatalog, setChecksum, setComStmtPrepareExecuteField, setExecuteMode, setIterationCount, setLocalInfileInputStream, setMaxRows, setNetworkStatisticsFlag, setReadonly, setTimeout, setTransactionIsolation, setUsername, stopIfInterruptedprotected static final Logger lockLogger
protected final ReentrantLock lock
protected final UrlParser urlParser
protected final Options options
protected final LruTraceCache traceCache
protected String username
public boolean hasWarnings
public Results activeStreamingResult
public short serverStatus
protected int autoIncrementIncrement
protected Socket socket
protected PacketOutputStream writer
protected boolean readOnly
protected PacketInputStream reader
protected FailoverProxy proxy
protected volatile boolean connected
protected boolean explicitClosed
protected String database
protected long serverThreadId
protected ServerPrepareStatementCache serverPrepareStatementCache
protected boolean eofDeprecated
protected long serverCapabilities
protected int socketTimeout
protected ExceptionFactory exceptionFactory
protected String serverVersion
public boolean autoCommit
public int transactionIsolationLevel
protected byte[] seed
protected boolean useOceanBaseProtocolV20
protected boolean enableFullLinkTrace
protected boolean useNewExtraInfo
public AbstractConnectProtocol(UrlParser urlParser, GlobalStateInfo globalInfo, ReentrantLock lock, LruTraceCache traceCache)
urlParser - connection URL informationglobalInfo - server global variables informationlock - the lock for thread synchronisationtraceCache - trace cachepublic void close()
public void skip()
throws SQLException
skip 在接口中 ProtocolSQLException - exceptionprotected void cleanMemory()
public void setServerStatus(short serverStatus)
setServerStatus 在接口中 Protocolpublic void removeHasMoreResults()
removeHasMoreResults 在接口中 Protocolpublic void connect()
throws SQLException,
IOException
connect 在接口中 ProtocolSQLException - exceptionIOExceptionpublic void destroySocket()
protected void postConnectionQueries()
throws SQLException
SQLExceptionpublic boolean isClosed()
public boolean checkIfMaster()
throws SQLException
checkIfMaster 在接口中 ProtocolSQLException - if requesting infos for server fail.public void readEofPacket()
throws SQLException,
IOException
readEofPacket 在接口中 ProtocolSQLException - if not a End-of-file packetIOException - if connection error occurpublic void skipEofPacket()
throws SQLException,
IOException
skipEofPacket 在接口中 ProtocolSQLException - if not a End-of-file packetIOException - if connection error occurpublic void setHostFailedWithoutProxy()
setHostFailedWithoutProxy 在接口中 Protocolpublic UrlParser getUrlParser()
getUrlParser 在接口中 Protocolpublic boolean isMasterConnection()
isMasterConnection 在接口中 Protocol@Deprecated public void readPipelineCheckMaster() throws SQLException
SQLExceptionpublic boolean mustBeMasterConnection()
mustBeMasterConnection 在接口中 Protocolpublic boolean noBackslashEscapes()
noBackslashEscapes 在接口中 Protocolpublic void connectWithoutProxy()
throws SQLException
connectWithoutProxy 在接口中 ProtocolSQLException - exceptionpublic boolean shouldReconnectWithoutProxy()
shouldReconnectWithoutProxy 在接口中 Protocolpublic String getServerVersion()
getServerVersion 在接口中 Protocolpublic void setObServerVersion(String version)
setObServerVersion 在接口中 Protocolpublic String getObServerVersion()
getObServerVersion 在接口中 Protocolpublic boolean haveInformationSchemaParameters()
haveInformationSchemaParameters 在接口中 Protocolpublic boolean supportStmtPrepareExecute()
supportStmtPrepareExecute 在接口中 Protocolpublic boolean supportFetchWithOffset()
supportFetchWithOffset 在接口中 Protocolpublic void setFullLinkTraceModule(String module, String action)
setFullLinkTraceModule 在接口中 Protocolpublic String getFullLinkTraceModule()
getFullLinkTraceModule 在接口中 Protocolpublic void setFullLinkTraceAction(String action)
setFullLinkTraceAction 在接口中 Protocolpublic String getFullLinkTraceAction()
getFullLinkTraceAction 在接口中 Protocolpublic void setFullLinkTraceClientInfo(String clientInfo)
setFullLinkTraceClientInfo 在接口中 Protocolpublic String getFullLinkTraceClientInfo()
getFullLinkTraceClientInfo 在接口中 Protocolpublic void setFullLinkTraceIdentifier(String clientIdentifier)
setFullLinkTraceIdentifier 在接口中 Protocolpublic String getFullLinkTraceIdentifier()
getFullLinkTraceIdentifier 在接口中 Protocolpublic byte getFullLinkTraceLevel()
getFullLinkTraceLevel 在接口中 Protocolpublic double getFullLinkTraceSamplePercentage()
getFullLinkTraceSamplePercentage 在接口中 Protocolpublic byte getFullLinkTraceRecordPolicy()
getFullLinkTraceRecordPolicy 在接口中 Protocolpublic double getFullLinkTracePrintSamplePercentage()
public long getFullLinkTraceSlowQueryThreshold()
getFullLinkTraceSlowQueryThreshold 在接口中 Protocolpublic boolean getReadonly()
getReadonly 在接口中 Protocolpublic HostAddress getHostAddress()
getHostAddress 在接口中 Protocolpublic void setHostAddress(HostAddress host)
setHostAddress 在接口中 Protocolpublic FailoverProxy getProxy()
public void setProxy(FailoverProxy proxy)
public String getDatabase()
getDatabase 在接口中 Protocolpublic String getUsername()
getUsername 在接口中 Protocolpublic void parseVersion(String serverVersion)
parseVersion 在接口中 Protocolpublic int getMajorServerVersion()
getMajorServerVersion 在接口中 Protocolpublic int getMinorServerVersion()
getMinorServerVersion 在接口中 Protocolpublic boolean versionGreaterOrEqual(int major,
int minor,
int patch)
versionGreaterOrEqual 在接口中 Protocolmajor - major versionminor - minor versionpatch - patch versionpublic boolean getPinGlobalTxToPhysicalConnection()
getPinGlobalTxToPhysicalConnection 在接口中 Protocolpublic boolean hasWarnings()
hasWarnings 在接口中 Protocolpublic boolean isConnected()
isConnected 在接口中 Protocolpublic long getServerThreadId()
getServerThreadId 在接口中 Protocolpublic boolean isExplicitClosed()
isExplicitClosed 在接口中 Protocolpublic TimeZone getTimeZone()
getTimeZone 在接口中 Protocolpublic TimeZone getServerTimeZone()
public Options getOptions()
getOptions 在接口中 Protocolpublic void setHasWarnings(boolean hasWarnings)
setHasWarnings 在接口中 Protocolpublic Results getActiveStreamingResult()
getActiveStreamingResult 在接口中 Protocolpublic void setActiveStreamingResult(Results activeStreamingResult)
setActiveStreamingResult 在接口中 Protocolpublic void removeActiveStreamingResult()
removeActiveStreamingResult 在接口中 Protocolpublic ReentrantLock getLock()
public boolean hasMoreResults()
hasMoreResults 在接口中 Protocolpublic ServerPrepareStatementCache prepareStatementCache()
prepareStatementCache 在接口中 Protocolpublic abstract void executeQuery(String sql) throws SQLException
executeQuery 在接口中 ProtocolSQLExceptionpublic void changeSocketTcpNoDelay(boolean setTcpNoDelay)
changeSocketTcpNoDelay 在接口中 ProtocolsetTcpNoDelay - value to set.public void changeSocketSoTimeout(int setSoTimeout)
throws SocketException
changeSocketSoTimeout 在接口中 ProtocolSocketExceptionpublic boolean isServerMariaDb()
isServerMariaDb 在接口中 Protocolpublic PacketInputStream getReader()
public boolean isEofDeprecated()
isEofDeprecated 在接口中 Protocolpublic boolean sessionStateAware()
sessionStateAware 在接口中 Protocolpublic String getTraces()
public boolean isOracleMode()
isOracleMode 在接口中 Protocolpublic void setOracleMode(boolean oracleMode)
public boolean isTZTablesImported()
isTZTablesImported 在接口中 Protocolpublic String getEncoding()
getEncoding 在接口中 Protocolpublic PacketOutputStream getWriter()
public HostAddress getCurrentHost()
getCurrentHost 在接口中 Protocolpublic void startCallInterface()
startCallInterface 在接口中 Protocolpublic void endCallInterface(String message)
endCallInterface 在接口中 Protocolpublic TimeTrace getTimeTrace()
getTimeTrace 在接口中 Protocolprotected void whyConnectedIsFalse()
public int getServerStatus()
getServerStatus 在接口中 ProtocolCopyright © 2024 oceanbase.com. All rights reserved.