Class RowSetFactory

java.lang.Object
io.deephaven.engine.rowset.RowSetFactory

public abstract class RowSetFactory extends Object
Repository of factory methods for constructing row sets.
  • Field Details

  • Method Details

    • empty

      public static WritableRowSet empty()
      Get an empty WritableRowSet.
      Returns:
      A new WritableRowSet containing no rows
    • fromKeys

      public static WritableRowSet fromKeys(long... rowKeys)
      Get a WritableRowSet containing the specified row keys. Row keys must be nonnegative numbers.
      Parameters:
      rowKeys - The row keys to include
      Returns:
      A new WritableRowSet containing the specified row keys
    • fromKeys

      public static WritableRowSet fromKeys(long rowKey)
      Produce a WritableRowSet containing a single row key. Row keys must be nonnegative numbers.
      Parameters:
      rowKey - The row key to include
      Returns:
      A new WritableRowSet containing the specified row key
    • fromRange

      public static WritableRowSet fromRange(long firstRowKey, long lastRowKey)
      Create a WritableRowSet containing the continuous range [firstRowKey, lastRowKey]. The range must hold at least one row key: 0 <= firstRowKey <= lastRowKey.
      Parameters:
      firstRowKey - The first row key in the continuous range
      lastRowKey - The last row key in the continuous range
      Returns:
      A new WritableRowSet containing the specified row key range
    • flat

      public static WritableRowSet flat(long size)
      Get a flat WritableRowSet containing the row key range [0, size), or an empty row set if size == 0.
      Parameters:
      size - The size of the WritableRowSet to create
      Returns:
      A flat WritableRowSet containing the row key range [0, size) or an empty row set if the size == 0
    • builderRandom

      public static RowSetBuilderRandom builderRandom()
      Returns:
      A RowSetBuilderRandom suitable for inserting row keys and row key ranges in no particular order
    • builderSequential

      public static RowSetBuilderSequential builderSequential()
      Returns:
      A RowSetBuilderRandom optimized for inserting row keys and row key ranges sequentially in order
    • union

      public static WritableRowSet union(Collection<? extends RowSet> rowSets)
      Construct a new WritableRowSet from the union of rowSets, leaving the inputs untouched.

      The caller keeps ownership of rowSets and remains responsible for closing them. Considering only the nonempty inputs: if none exist empty() is returned; if exactly one exists a copy of it is returned.

      Parameters:
      rowSets - The row sets to union
      Returns:
      A new WritableRowSet containing every row key in rowSets
    • union

      public static WritableRowSet union(RowSet... rowSets)
      Construct a new WritableRowSet from the union of rowSets, leaving the inputs untouched.

      The array itself is not reordered. See union(Collection) for the ownership and result contract.

      Parameters:
      rowSets - The row sets to union
      Returns:
      A new WritableRowSet containing every row key in rowSets
    • unionInsert

      @Deprecated(forRemoval=true) public static WritableRowSet unionInsert(Collection<RowSet> rowSets)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs a new combined WritableRowSet from the union of rowSets.
      Parameters:
      rowSets - the input row sets
      Returns:
      the new row set