Package org.mariadb.jdbc.client.impl
Class ReplayClient
- java.lang.Object
-
- org.mariadb.jdbc.client.impl.StandardClient
-
- org.mariadb.jdbc.client.impl.ReplayClient
-
- All Implemented Interfaces:
AutoCloseable,org.mariadb.jdbc.client.Client
public class ReplayClient extends StandardClient
Replay client wrapper
-
-
Field Summary
-
Fields inherited from class org.mariadb.jdbc.client.impl.StandardClient
context, exceptionFactory, writer
-
-
Constructor Summary
Constructors Constructor Description ReplayClient(Configuration conf, HostAddress hostAddress, ReentrantLock lock, boolean skipPostCommands)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<org.mariadb.jdbc.client.Completion>execute(org.mariadb.jdbc.message.ClientMessage message, Statement stmt, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion, boolean canRedo)Send client message and read resultList<org.mariadb.jdbc.client.Completion>executePipeline(org.mariadb.jdbc.message.ClientMessage[] messages, Statement stmt, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion, boolean canRedo)Send client messages pipelining and read resultintsendQuery(org.mariadb.jdbc.message.ClientMessage message)Send client message to servervoidtransactionReplay(TransactionSaver transactionSaver)Replay transaction, re-prepare server command if needed-
Methods inherited from class org.mariadb.jdbc.client.impl.StandardClient
abort, checkNotClosed, close, closePrepare, createSessionVariableQuery, destroySocket, execute, execute, getContext, getExceptionFactory, getHostAddress, getSocketTimeout, isClosed, isPrimary, readPacket, readPacket, readResponse, readResponse, readStreamingResults, reset, setReadOnly, setSocketTimeout
-
-
-
-
Constructor Detail
-
ReplayClient
public ReplayClient(Configuration conf, HostAddress hostAddress, ReentrantLock lock, boolean skipPostCommands) throws SQLException
Constructor- Parameters:
conf- configurationhostAddress- hostlock- thread lock objectskipPostCommands- must skip connection post commands- Throws:
SQLException- if connection fails
-
-
Method Detail
-
sendQuery
public int sendQuery(org.mariadb.jdbc.message.ClientMessage message) throws SQLExceptionDescription copied from class:StandardClientSend client message to server- Overrides:
sendQueryin classStandardClient- Parameters:
message- client message- Returns:
- number of command send
- Throws:
SQLException- if socket error occurs
-
executePipeline
public List<org.mariadb.jdbc.client.Completion> executePipeline(org.mariadb.jdbc.message.ClientMessage[] messages, Statement stmt, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion, boolean canRedo) throws SQLException
Description copied from interface:org.mariadb.jdbc.client.ClientSend client messages pipelining and read result- Specified by:
executePipelinein interfaceorg.mariadb.jdbc.client.Client- Overrides:
executePipelinein classStandardClient- Parameters:
messages- client messagestmt- statementfetchSize- fetch sizemaxRows- maximum number of rows. 0 = allresultSetConcurrency- concurrencyresultSetType- result-set typecloseOnCompletion- close statement on completioncanRedo- can client message be redone in case of failover- Returns:
- results
- Throws:
SQLException- if any error occurs
-
execute
public List<org.mariadb.jdbc.client.Completion> execute(org.mariadb.jdbc.message.ClientMessage message, Statement stmt, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion, boolean canRedo) throws SQLException
Description copied from interface:org.mariadb.jdbc.client.ClientSend client message and read result- Specified by:
executein interfaceorg.mariadb.jdbc.client.Client- Overrides:
executein classStandardClient- Parameters:
message- client messagestmt- statementfetchSize- fetch sizemaxRows- maximum number of rows. 0 = allresultSetConcurrency- concurrencyresultSetType- result-set typecloseOnCompletion- close statement on completioncanRedo- can client message be redone in case of failover- Returns:
- results
- Throws:
SQLException- if any error occurs
-
transactionReplay
public void transactionReplay(TransactionSaver transactionSaver) throws SQLException
Replay transaction, re-prepare server command if needed- Parameters:
transactionSaver- transaction cache- Throws:
SQLException- if any error occurs
-
-