Class RowSequenceRowKeysChunkImpl

java.lang.Object
io.deephaven.engine.rowset.impl.RowSequenceRowKeysChunkImpl
All Implemented Interfaces:
RowSequence, LongSizedDataStructure, SafeCloseable, AutoCloseable

public class RowSequenceRowKeysChunkImpl extends Object implements RowSequence
  • Method Details

    • makeByWrapping

      public static RowSequenceRowKeysChunkImpl makeByWrapping(LongChunk<OrderedRowKeys> backingChunk)
    • makeByTaking

      public static RowSequenceRowKeysChunkImpl makeByTaking(WritableLongChunk<OrderedRowKeys> backingChunkToOwn)
    • getRowSequenceIterator

      public final RowSequence.Iterator getRowSequenceIterator()
      Description copied from interface: RowSequence
      Get an RowSequence.Iterator over this RowSequence.
      Specified by:
      getRowSequenceIterator in interface RowSequence
      Returns:
      A new iterator, positioned at the first row key
    • getRowSequenceByPosition

      public final RowSequence getRowSequenceByPosition(long startPositionInclusive, long length)
      Description copied from interface: RowSequence

      Get an ordered subset of the row keys in this RowSequence for a position range. The result will contain the set of row keys in this that lie at positions in the half-open range [startPositionInclusive, startPositionInclusive + length). The returned reference is owned by the caller, who should call close() when it is done with it.

      Specified by:
      getRowSequenceByPosition in interface RowSequence
      Parameters:
      startPositionInclusive - The position of the first row key to include
      length - The number of row keys to include
      Returns:
      The subset as an RowSequence, which may be this
    • getRowSequenceByKeyRange

      public final RowSequence getRowSequenceByKeyRange(long startRowKeyInclusive, long endRowKeyInclusive)
      Description copied from interface: RowSequence

      Get an ordered subset of the row keys in this RowSequence for a row key range. The returned set will be the intersection of the row keys in this with the row keys in the closed interval [startRowKeyInclusive, endRowKeyInclusive]. The returned reference is owned by the caller, who should call close() when it is done with it.

      Specified by:
      getRowSequenceByKeyRange in interface RowSequence
      Parameters:
      startRowKeyInclusive - The minimum row key to include
      endRowKeyInclusive - The maximum row key to include
      Returns:
      The subset as an RowSequence, which may be this
    • asRowSet

      public final RowSet asRowSet()
      Description copied from interface: RowSequence
      Get a RowSet representation of this RowSequence.
      Specified by:
      asRowSet in interface RowSequence
      Returns:
      A RowSet representation for the same row keys in the same order
    • asRowKeyChunk

      public final LongChunk<OrderedRowKeys> asRowKeyChunk()
      Description copied from interface: RowSequence
      Get a LongChunk representation of the individual row keys in this RowSequence.
      Specified by:
      asRowKeyChunk in interface RowSequence
      Returns:
      A LongChunk containing the row keys in this RowSequence
    • asRowKeyRangesChunk

      public final LongChunk<OrderedRowKeyRanges> asRowKeyRangesChunk()
      Description copied from interface: RowSequence
      Get a LongChunk representation of row key ranges in this RowSequence.
      Specified by:
      asRowKeyRangesChunk in interface RowSequence
      Returns:
      A LongChunk containing the row key ranges in this RowSequence
    • fillRowKeyChunk

      public final void fillRowKeyChunk(WritableLongChunk<? super OrderedRowKeys> chunkToFill)
      Description copied from interface: RowSequence

      Fill the supplied WritableLongChunk with individual row keys from this RowSequence.

      The chunk's capacity is assumed to be big enough.

      Specified by:
      fillRowKeyChunk in interface RowSequence
      Parameters:
      chunkToFill - A chunk to fill with individual row keys
    • fillRowKeyRangesChunk

      public final void fillRowKeyRangesChunk(WritableLongChunk<OrderedRowKeyRanges> chunkToFill)
      Description copied from interface: RowSequence

      Fill the supplied WritableLongChunk with row key ranges from this RowSequence.

      The chunk's capacity is assumed to be big enough.

      Specified by:
      fillRowKeyRangesChunk in interface RowSequence
      Parameters:
      chunkToFill - A chunk to fill with row key ranges
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: RowSequence
      True if the size of this RowSequence is zero.
      Specified by:
      isEmpty in interface RowSequence
      Returns:
      True if there are no elements in this RowSequence.
    • firstRowKey

      public long firstRowKey()
      Description copied from interface: RowSequence
      Get the first row key in this RowSequence.
      Specified by:
      firstRowKey in interface RowSequence
      Returns:
      The first row key, or RowSequence.NULL_ROW_KEY if there is none.
    • lastRowKey

      public long lastRowKey()
      Description copied from interface: RowSequence
      Get the last row key in this RowSequence.
      Specified by:
      lastRowKey in interface RowSequence
      Returns:
      The last row key, or RowSequence.NULL_ROW_KEY if there is none.
    • size

      public final long size()
      Description copied from interface: RowSequence
      Get the number of row keys in this RowSequence.
      Specified by:
      size in interface LongSizedDataStructure
      Specified by:
      size in interface RowSequence
      Returns:
      The size, in [0, Long.MAX_VALUE]
    • getAverageRunLengthEstimate

      public long getAverageRunLengthEstimate()
      Description copied from interface: RowSequence

      Get an estimate of the average (mean) length of runs of adjacent row keys in this RowSequence.

      Implementations should strive to keep this method efficient (O(1) preferred) at the expense of accuracy.

      Empty RowSequence should return an arbitrary valid value, usually 1.

      Specified by:
      getAverageRunLengthEstimate in interface RowSequence
      Returns:
      An estimate of the average run length in this RowSequence, in [1, size()]
    • forEachRowKey

      public boolean forEachRowKey(LongAbortableConsumer lc)
      Description copied from interface: RowSequence
      For as long as the consumer wants more row keys, call accept on the consumer with the individual row key instances in this RowSequence, in increasing order.
      Specified by:
      forEachRowKey in interface RowSequence
      Parameters:
      lc - a consumer to feed the individual row key values to.
      Returns:
      false if the consumer provided ever returned false, true otherwise.
    • forEachRowKeyRange

      public boolean forEachRowKeyRange(LongRangeAbortableConsumer lc)
      Description copied from interface: RowSequence
      For as long as the consumer wants more ranges, call accept on the consumer with the individual row key ranges in this RowSequence, in increasing order.
      Specified by:
      forEachRowKeyRange in interface RowSequence
      Parameters:
      lc - a consumer to feed the individual row key values to.
      Returns:
      false if the consumer provided ever returned false, true otherwise.
    • close

      public void close()
      Description copied from interface: RowSequence

      Free any resources associated with this object.

      Using any RowSequence methods after close() is an error and may produce exceptions or undefined results.

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface RowSequence
      Specified by:
      close in interface SafeCloseable