Interface TrackingRowSet

All Superinterfaces:
AutoCloseable, LogOutputAppendable, LongSizedDataStructure, RowSequence, RowSet, SafeCloseable
All Known Subinterfaces:
TrackingWritableRowSet
All Known Implementing Classes:
TrackingWritableRowSetImpl

public interface TrackingRowSet extends RowSet

RowSet that internally tracks changes and maintains a consistent snapshot of its previous state, valid during the updating phase of its associated LogicalClock.

Also adds support for hosting opaque index information.

  • Method Details

    • sizePrev

      long sizePrev()
      Get the size of this TrackingRowSet as of the end of the previous update graph cycle.
      Returns:
      The previous size
    • intSizePrev

      default int intSizePrev()
      Get the size of this TrackingRowSet as of the end of the previous update graph cycle, constrained to be between 0 and 2147483647.
      Returns:
      The previous size, as an int
    • copyPrev

      WritableRowSet copyPrev()
      Get a copy of the value of this TrackingRowSet as of the end of the previous update graph cycle. As in other operations that return a WritableRowSet, the result must be closed by the caller when it is no longer needed. The result will never be a TrackingRowSet; use WritableRowSet.toTracking() on the result as needed.
      Returns:
      A copy of the previous value
    • prev

      RowSet prev()
      Access the read-only value of this TrackingRowSet as of the end of the previous update graph cycle. The returned RowSet must not be mutated or closed; it belongs to this TrackingRowSet. Callers should be sure to only use the result during the updating phase of a cycle, and never across logical clock phases/steps.
      Returns:
      A read-only view of the previous value, owned by this TrackingRowSet
    • getPrev

      long getPrev(long rowPosition)
      Same as get(rowPosition), as of the end of the previous update graph cycle.
      Parameters:
      rowPosition - A row position in this RowSet between 0 and sizePrev() - 1.
      Returns:
      The row key previously at the supplied row position
    • firstRowKeyPrev

      long firstRowKeyPrev()
      Same as firstRowKey(), as of the end of the previous update graph cycle.
      Returns:
      The previous first row key
    • lastRowKeyPrev

      long lastRowKeyPrev()
      Same as lastRowKey(), as of the end of the previous update graph cycle.
      Returns:
      The previous last row key
    • findPrev

      long findPrev(long rowKey)
      Returns the position in [0..(size-1)] where the row key is found in the previous value of this. If not found, then return (-(position it would be) - 1), as in Array.binarySearch.
      Parameters:
      rowKey - The row key to search for
      Returns:
      A position from [0..(size-1)] if the row key was found. If the row key was not found, then (-position - 1) as in Array.binarySearch
    • indexer

      <INDEXER_TYPE extends TrackingRowSet.Indexer> INDEXER_TYPE indexer(@NotNull @NotNull Function<TrackingRowSet,INDEXER_TYPE> indexerFactory)
      Get an opaque TrackingRowSet.Indexer object previously associated with this TrackingRowSet, or set and get one created with indexerFactory if this is the first invocation.
      Parameters:
      indexerFactory - The indexer factory to be used if no indexer has been set previously
      Returns:
      An opaque indexer object associated with this TrackingRowSet
    • indexer

      <INDEXER_TYPE extends TrackingRowSet.Indexer> INDEXER_TYPE indexer()
      Get an opaque TrackingRowSet.Indexer object previously associated with this TrackingRowSet.
      Returns:
      An opaque indexer object associated with this TrackingRowSet, or null if none has been set
    • writableCast

      default TrackingWritableRowSet writableCast()
      Description copied from interface: RowSet

      Cast this RowSet reference to a WritableRowSet.

      Specified by:
      writableCast in interface RowSet
      Returns:
      this cast to a WritableRowSet