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:
java.lang.AutoCloseable,Client
public class ReplayClient extends StandardClient
Replay client wrapper
-
-
Field Summary
Fields Modifier and Type Field Description private static Loggerlogger-
Fields inherited from class org.mariadb.jdbc.client.impl.StandardClient
context, exceptionFactory, writer
-
-
Constructor Summary
Constructors Constructor Description ReplayClient(Configuration conf, HostAddress hostAddress, ClosableLock lock, boolean skipPostCommands)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Completion>execute(ClientMessage message, Statement stmt, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion, boolean canRedo)Send client message and read resultjava.util.List<Completion>executePipeline(ClientMessage[] messages, Statement stmt, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion, boolean canRedo)Send client messages pipelining and read resultintsendQuery(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, authenticationHandler, checkNotClosed, close, closePrepare, createSessionVariableQuery, destroySocket, execute, execute, getContext, getExceptionFactory, getHostAddress, getSocketIp, getSocketTimeout, isClosed, isPrimary, readPacket, readPacket, readResponse, readResponse, readStreamingResults, redirect, reset, setReadOnly, setSocketTimeout, sslWrapper
-
-
-
-
Field Detail
-
logger
private static final Logger logger
-
-
Constructor Detail
-
ReplayClient
public ReplayClient(Configuration conf, HostAddress hostAddress, ClosableLock lock, boolean skipPostCommands) throws java.sql.SQLException
Constructor- Parameters:
conf- configurationhostAddress- hostlock- thread lock objectskipPostCommands- must skip connection post commands- Throws:
java.sql.SQLException- if connection fails
-
-
Method Detail
-
sendQuery
public int sendQuery(ClientMessage message) throws java.sql.SQLException
Description copied from class:StandardClientSend client message to server- Overrides:
sendQueryin classStandardClient- Parameters:
message- client message- Returns:
- number of command send
- Throws:
java.sql.SQLException- if socket error occurs
-
executePipeline
public java.util.List<Completion> executePipeline(ClientMessage[] messages, Statement stmt, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion, boolean canRedo) throws java.sql.SQLException
Description copied from interface:ClientSend client messages pipelining and read result- Specified by:
executePipelinein interfaceClient- 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:
java.sql.SQLException- if any error occurs
-
execute
public java.util.List<Completion> execute(ClientMessage message, Statement stmt, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion, boolean canRedo) throws java.sql.SQLException
Description copied from interface:ClientSend client message and read result- Specified by:
executein interfaceClient- 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:
java.sql.SQLException- if any error occurs
-
transactionReplay
public void transactionReplay(TransactionSaver transactionSaver) throws java.sql.SQLException
Replay transaction, re-prepare server command if needed- Parameters:
transactionSaver- transaction cache- Throws:
java.sql.SQLException- if any error occurs
-
-