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 class
InteractiveTransaction.TransactionStatus
The enum types of the transaction status.
-
Field Summary
Fields Modifier and Type Field Description protected AntidoteClient
antidoteClient
The antidote client.protected Connection
connection
The explicit connection object.protected com.google.protobuf.ByteString
descriptor
The descriptor.protected InteractiveTransaction.TransactionStatus
transactionStatus
The transaction status.
-
Constructor Summary
Constructors Constructor Description InteractiveTransaction(AntidoteClient antidoteClient)
Instantiates a new antidote transaction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abortTransaction()
Abort transaction.void
close()
Close the transaction.CommitInfo
commitTransaction()
Commit transaction.protected AntidoteClient
getClient()
Get the antidote client.protected com.google.protobuf.ByteString
getDescriptor()
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.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.-
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
-
-
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:
close
in interfacejava.lang.AutoCloseable
-
-