Package eu.antidotedb.client
Class InteractiveTransaction
- java.lang.Object
-
- eu.antidotedb.client.AntidoteTransaction
-
- eu.antidotedb.client.TransactionWithReads
-
- eu.antidotedb.client.InteractiveTransaction
-
- All Implemented Interfaces:
UpdateContext,java.lang.AutoCloseable
public class InteractiveTransaction extends TransactionWithReads implements java.lang.AutoCloseable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classInteractiveTransaction.TransactionStatusThe enum types of the transaction status.
-
Field Summary
Fields Modifier and Type Field Description protected AntidoteClientantidoteClientThe antidote client.protected ConnectionconnectionThe explicit connection object.protected com.google.protobuf.ByteStringdescriptorThe descriptor.protected InteractiveTransaction.TransactionStatustransactionStatusThe transaction status.
-
Constructor Summary
Constructors Constructor Description InteractiveTransaction(AntidoteClient antidoteClient)Instantiates a new antidote transaction.InteractiveTransaction(AntidoteClient antidoteClient, CommitInfo timestamp)Instantiates a new antidote transaction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabortTransaction()Abort transaction.voidclose()Close the transaction.CommitInfocommitTransaction()Commit transaction.protected AntidoteClientgetClient()Get the antidote client.protected com.google.protobuf.ByteStringgetDescriptor()protected AntidotePB.ApbReadObjectsRespreadHelper(com.google.protobuf.ByteString bucket, com.google.protobuf.ByteString key, AntidotePB.CRDT_type type)Read helper that has the generic part of the code.protected voidupdateHelper(AntidotePB.ApbUpdateOperation.Builder operation, java.lang.String name, java.lang.String bucket, AntidotePB.CRDT_type type)Update helper that has the generic part of the code.-
Methods inherited from class eu.antidotedb.client.AntidoteTransaction
onGetConnection, onReleaseConnection
-
-
-
-
Field Detail
-
connection
protected Connection connection
The explicit connection object.
-
antidoteClient
protected final AntidoteClient antidoteClient
The antidote client.
-
transactionStatus
protected InteractiveTransaction.TransactionStatus transactionStatus
The transaction status.
-
descriptor
protected com.google.protobuf.ByteString descriptor
The descriptor.
-
-
Constructor Detail
-
InteractiveTransaction
public InteractiveTransaction(AntidoteClient antidoteClient)
Instantiates a new antidote transaction.- Parameters:
antidoteClient- the antidote client
-
InteractiveTransaction
public InteractiveTransaction(AntidoteClient antidoteClient, CommitInfo timestamp)
Instantiates a new antidote transaction.- Parameters:
antidoteClient- the antidote clienttimestamp- the minimum timestamp this transaction should be based on
-
-
Method Detail
-
getClient
protected AntidoteClient getClient()
Get the antidote client.- Returns:
- the antidote client
-
commitTransaction
public CommitInfo commitTransaction()
Commit transaction.
-
abortTransaction
public void abortTransaction()
Abort transaction.
-
updateHelper
protected void updateHelper(AntidotePB.ApbUpdateOperation.Builder operation, java.lang.String name, java.lang.String bucket, AntidotePB.CRDT_type type)
Update helper that has the generic part of the code.- Parameters:
operation- the operationname- the namebucket- the buckettype- the type
-
readHelper
protected AntidotePB.ApbReadObjectsResp readHelper(com.google.protobuf.ByteString bucket, com.google.protobuf.ByteString key, AntidotePB.CRDT_type type)
Read helper that has the generic part of the code.- Returns:
- the apb read objects resp
-
getDescriptor
protected com.google.protobuf.ByteString getDescriptor()
-
close
public void close()
Close the transaction.- Specified by:
closein interfacejava.lang.AutoCloseable
-
-