Interface SegmentTransaction<Type>

  • All Superinterfaces:
    java.lang.AutoCloseable

    public interface SegmentTransaction<Type>
    extends java.lang.AutoCloseable
    The mirror of Transaction but that is specific to one segment.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Calls flush() and then closes the connection.
      void flush()
      Blocks until all events passed to the write call have made it to durable storage.
      java.util.UUID getId()  
      void writeEvent​(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 after flush() 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 TxnFailedException
        Blocks 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)