Class TransactionalOnlineAttributeWriter
- java.lang.Object
-
- cz.o2.proxima.direct.core.transaction.TransactionalOnlineAttributeWriter
-
- All Implemented Interfaces:
AttributeWriterBase
,OnlineAttributeWriter
,java.lang.AutoCloseable
public class TransactionalOnlineAttributeWriter extends java.lang.Object implements OnlineAttributeWriter
AOnlineAttributeWriter
that enforces transactions for each write.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
TransactionalOnlineAttributeWriter.Transaction
static interface
TransactionalOnlineAttributeWriter.TransactionAware
Interface for a transformation to get access toTransactionalOnlineAttributeWriter.Transaction
.static class
TransactionalOnlineAttributeWriter.TransactionPreconditionFailedException
static class
TransactionalOnlineAttributeWriter.TransactionRejectedException
static class
TransactionalOnlineAttributeWriter.TransactionRejectedRuntimeException
This exception might be thrown in place ofTransactionalOnlineAttributeWriter.TransactionRejectedException
where fromTransactionalOnlineAttributeWriter.TransactionAware
transformations where theElementWiseTransformation.apply(StreamElement, Collector)
does not allow for throwing checked exceptions directly.static class
TransactionalOnlineAttributeWriter.TransactionValidator
Base class for enforcing constraints on outputs of transaction (e.g.-
Nested classes/interfaces inherited from interface cz.o2.proxima.direct.core.AttributeWriterBase
AttributeWriterBase.Type
-
Nested classes/interfaces inherited from interface cz.o2.proxima.direct.core.OnlineAttributeWriter
OnlineAttributeWriter.Factory<T extends OnlineAttributeWriter>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OnlineAttributeWriter.Factory<? extends OnlineAttributeWriter>
asFactory()
Convert instance of this writer toAttributeWriterBase.Factory
suitable for serialization.TransactionalOnlineAttributeWriter.Transaction
begin()
TransactionalOnlineAttributeWriter.Transaction
begin(java.lang.String transactionId)
void
close()
Close allocated resources of this writer.java.net.URI
getUri()
Retrieve URI of this writer.static TransactionalOnlineAttributeWriter
global(DirectDataOperator direct)
boolean
isTransactional()
static TransactionalOnlineAttributeWriter
of(DirectDataOperator direct, OnlineAttributeWriter delegate)
TransactionalOnlineAttributeWriter
transactional()
void
write(StreamElement data, CommitCallback statusCallback)
Write given serialized attribute value to given entity.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cz.o2.proxima.direct.core.AttributeWriterBase
bulk, online
-
Methods inherited from interface cz.o2.proxima.direct.core.OnlineAttributeWriter
getType, rollback
-
-
-
-
Method Detail
-
of
public static TransactionalOnlineAttributeWriter of(DirectDataOperator direct, OnlineAttributeWriter delegate)
-
global
public static TransactionalOnlineAttributeWriter global(DirectDataOperator direct)
-
getUri
public java.net.URI getUri()
Description copied from interface:AttributeWriterBase
Retrieve URI of this writer.- Specified by:
getUri
in interfaceAttributeWriterBase
- Returns:
- URI of this writer
-
close
public void close()
Description copied from interface:AttributeWriterBase
Close allocated resources of this writer. This is supposed to be idempotent.- Specified by:
close
in interfaceAttributeWriterBase
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
write
public void write(StreamElement data, CommitCallback statusCallback)
Description copied from interface:OnlineAttributeWriter
Write given serialized attribute value to given entity.- Specified by:
write
in interfaceOnlineAttributeWriter
- Parameters:
data
- the data to writestatusCallback
- callback used to commit data processing
-
asFactory
public OnlineAttributeWriter.Factory<? extends OnlineAttributeWriter> asFactory()
Description copied from interface:AttributeWriterBase
Convert instance of this writer toAttributeWriterBase.Factory
suitable for serialization.- Specified by:
asFactory
in interfaceAttributeWriterBase
- Specified by:
asFactory
in interfaceOnlineAttributeWriter
- Returns:
- the
AttributeWriterBase.Factory
representing this reader
-
isTransactional
public boolean isTransactional()
- Specified by:
isTransactional
in interfaceOnlineAttributeWriter
- Returns:
true
is this is aTransactionalOnlineAttributeWriter
.TransactionalOnlineAttributeWriter
is used when writing attribute that supportsTransactionMode
different fromTransactionMode.NONE
.
-
transactional
public TransactionalOnlineAttributeWriter transactional()
- Specified by:
transactional
in interfaceOnlineAttributeWriter
- Returns:
this
ifOnlineAttributeWriter.isTransactional()
returns true.
-
begin
public TransactionalOnlineAttributeWriter.Transaction begin()
-
begin
public TransactionalOnlineAttributeWriter.Transaction begin(java.lang.String transactionId)
-
-