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 Logger
logger
-
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 resultint
sendQuery(ClientMessage message)
Send client message to servervoid
transactionReplay(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:StandardClient
Send client message to server- Overrides:
sendQuery
in 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:Client
Send client messages pipelining and read result- Specified by:
executePipeline
in interfaceClient
- Overrides:
executePipeline
in 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:Client
Send client message and read result- Specified by:
execute
in interfaceClient
- Overrides:
execute
in 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
-
-