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 calling Transaction.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 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 for EventWriterConfig.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 calling Transaction.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 interface java.lang.AutoCloseable