Package io.pravega.client.stream
Interface TransactionalEventStreamWriter<Type>
-
- All Superinterfaces:
java.lang.AutoCloseable
public interface TransactionalEventStreamWriter<Type> extends java.lang.AutoCloseable
A writer that writes Events to an Event stream transactionally. All events that are written as part of a transaction can be committed atomically by callingTransaction.commit()
. This will result in either all of those events going into the stream or none of them and the commit call failing with an exception. Prior to committing a transaction, the events written to it cannot be read or otherwise seen by readers.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Transaction<Type>
beginTxn()
Start a new transaction on this stream.void
close()
Closes the writer.EventWriterConfig
getConfig()
Returns the configuration that this writer was created with.Transaction<Type>
getTxn(java.util.UUID transactionId)
Returns a previously created transaction.
-
-
-
Method Detail
-
beginTxn
Transaction<Type> beginTxn()
Start a new transaction on this stream. This allows events written to the transaction be written an committed atomically. Note that transactions can only be open forEventWriterConfig.transactionTimeoutTime
.- Returns:
- A transaction through which multiple events can be written atomically.
-
getTxn
Transaction<Type> getTxn(java.util.UUID transactionId)
Returns a previously created transaction.- Parameters:
transactionId
- The result retained from callingTransaction.getTxnId()
- Returns:
- Transaction object with given UUID
-
getConfig
EventWriterConfig getConfig()
Returns the configuration that this writer was created with.- Returns:
- Writer configuration
-
close
void close()
Closes the writer. (No further methods may be called)- Specified by:
close
in interfacejava.lang.AutoCloseable
-
-