Package io.pravega.client.stream.impl
Interface SegmentTransaction<Type>
-
- All Superinterfaces:
java.lang.AutoCloseable
public interface SegmentTransaction<Type> extends java.lang.AutoCloseableThe mirror of Transaction but that is specific to one segment.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Callsflush()and then closes the connection.voidflush()Blocks until all events passed to the write call have made it to durable storage.java.util.UUIDgetId()voidwriteEvent(Type event)Writes the provided event to this transaction on this segment.
-
-
-
Method Detail
-
getId
java.util.UUID getId()
-
writeEvent
void writeEvent(Type event) throws TxnFailedException
Writes the provided event to this transaction on this segment. This operation is asynchronous, the item is not Guaranteed to be stored until afterflush()has been called.- Parameters:
event- The event to write.- Throws:
TxnFailedException- The item could be persisted because the transaction has failed. (Timed out or aborted)
-
flush
void flush() throws TxnFailedExceptionBlocks until all events passed to the write call have made it to durable storage. After this the transaction can be committed.- Throws:
TxnFailedException- Not all of the items could be persisted because the transaction has failed. (Timed out or aborted)
-
close
void close() throws TxnFailedExceptionCallsflush()and then closes the connection.- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
TxnFailedException
-
-