Package io.pravega.client.stream.impl
Class TransactionalEventStreamWriterImpl<Type>
- java.lang.Object
-
- io.pravega.client.stream.impl.TransactionalEventStreamWriterImpl<Type>
-
- Type Parameters:
Type- The type of event that is sent
- All Implemented Interfaces:
TransactionalEventStreamWriter<Type>,java.lang.AutoCloseable
public class TransactionalEventStreamWriterImpl<Type> extends java.lang.Object implements TransactionalEventStreamWriter<Type>
This class creates transactions, and manages their lifecycle.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Transaction<Type>beginTxn()Start a new transaction on this stream.voidclose()Closes the writer.EventWriterConfiggetConfig()Returns the configuration that this writer was created with.Transaction<Type>getTxn(java.util.UUID txId)Returns a previously created transaction.java.lang.StringtoString()
-
-
-
Method Detail
-
beginTxn
public Transaction<Type> beginTxn()
Description copied from interface:TransactionalEventStreamWriterStart 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.- Specified by:
beginTxnin interfaceTransactionalEventStreamWriter<Type>- Returns:
- A transaction through which multiple events can be written atomically.
-
getTxn
public Transaction<Type> getTxn(java.util.UUID txId)
Description copied from interface:TransactionalEventStreamWriterReturns a previously created transaction.- Specified by:
getTxnin interfaceTransactionalEventStreamWriter<Type>- Parameters:
txId- The result retained from callingTransaction.getTxnId()- Returns:
- Transaction object with given UUID
-
close
public void close()
Description copied from interface:TransactionalEventStreamWriterCloses the writer. (No further methods may be called)- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceTransactionalEventStreamWriter<Type>
-
getConfig
public EventWriterConfig getConfig()
Description copied from interface:TransactionalEventStreamWriterReturns the configuration that this writer was created with.- Specified by:
getConfigin interfaceTransactionalEventStreamWriter<Type>- Returns:
- Writer configuration
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-