Package org.mariadb.jdbc.client.impl
Class TransactionSaver
java.lang.Object
org.mariadb.jdbc.client.impl.TransactionSaver
Transaction cache Huge command are not cached, cache is limited to configuration
transactionReplaySize commands
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RedoableClientMessage[]private booleanprivate int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(RedoableClientMessage clientMessage) Add a command to cache.voidclear()Transaction finished, clearing cachecache bufferintgetIdx()Current transaction cache lengthbooleanisDirty()Is cache not valid (some commands have not been cached)
-
Field Details
-
buffers
-
idx
private int idx -
dirty
private boolean dirty
-
-
Constructor Details
-
TransactionSaver
public TransactionSaver(int transactionReplaySize) Constructor- Parameters:
transactionReplaySize- maximum number of command cached
-
-
Method Details
-
add
Add a command to cache.- Parameters:
clientMessage- client message
-
clear
public void clear()Transaction finished, clearing cache -
getIdx
public int getIdx()Current transaction cache length- Returns:
- cache length
-
isDirty
public boolean isDirty()Is cache not valid (some commands have not been cached)- Returns:
- is dirty
-
getBuffers
cache buffer- Returns:
- cached messages
-