Interface StreamOperation

All Known Subinterfaces:
StreamOperation.DeleteEvent, StreamOperation.PutEvent, StreamOperation.TransactionEvent

public interface StreamOperation
The operation (Put, Delete) that was delivered over the NoSQL stream.
  • Method Details

    • getSequenceId

      Returns the unique sequence id associated with this operation.
    • getRepGroupId

      int getRepGroupId()
      Returns the shard id associated with this operation.
    • includeBeforeImage

      boolean includeBeforeImage()
      Returns true if the current stream is configured to include before image, false otherwise
      Returns:
      true if the current stream is configured to include before image, false otherwise
    • isBeforeImageEnabled

      boolean isBeforeImageEnabled()
      Returns true if before image is enabled for the write operation in this event StreamOperation to the subscribed table in kvstore. Returns false if otherwise.
      Returns:
      true if the before image is enabled, or false.
    • isBeforeImageExpired

      boolean isBeforeImageExpired()
      Returns true if the before image is enabled for the write operation in this event StreamOperation but the before image has expired. If the before image is disabled for the table or the subscription is not configured to include before image, it returns false. For insert operations to the subscribed table, for which the before image is null, this method returns false.
      Returns:
      true if the before image is enabled and expired, or false.
    • getBeforeImage

      Row getBeforeImage()
      Returns the before image associated with the stream event represented by StreamOperation, or null if 1. the stream is not configured to include before image, or 2. the before image is not enabled for the event, or 3. the before image is enabled while it does not exist for operations like insert.
      Returns:
      the before image associated with the stream event, or null.
    • getType

      Returns the type of this operation.
      Returns:
      the type of this operation
    • asPut

      Converts this operation to a StreamOperation.PutEvent.
      Returns:
      this operation as a Put
      Throws:
      IllegalArgumentException - if this operation is not a Put
    • asDelete

      Converts this operation to a StreamOperation.DeleteEvent.
      Returns:
      this operation as a Delete
      Throws:
      IllegalArgumentException - if this operation is not a Delete
    • asTransaction

      default StreamOperation.TransactionEvent asTransaction()
      Converts this operation to a StreamOperation.TransactionEvent.
      Returns:
      this operation as a Transaction
      Throws:
      IllegalArgumentException - if this operation is not a Transaction