Package io.deephaven.engine.rowset
Class RowSetFactory
java.lang.Object
io.deephaven.engine.rowset.RowSetFactory
Repository of factory methods for constructing
row sets.-
Method Summary
Modifier and TypeMethodDescriptionstatic RowSetBuilderRandomstatic RowSetBuilderSequentialstatic WritableRowSetempty()Get an emptyWritableRowSet.static WritableRowSetflat(long size) static WritableRowSetfromKeys(long rowKey) Produce aWritableRowSetcontaining a single row key.static WritableRowSetfromKeys(long... rowKeys) Get aWritableRowSetcontaining the specified row keys.static WritableRowSetfromRange(long firstRowKey, long lastRowKey) Create aWritableRowSetcontaining the continuous range [firstRowKey, lastRowKey].static WritableRowSetunionInsert(Collection<RowSet> rowSets) Constructs a new combinedWritableRowSetfrom the union ofrowSets.
-
Method Details
-
empty
Get an emptyWritableRowSet.- Returns:
- A new
WritableRowSetcontaining no rows
-
fromKeys
Get aWritableRowSetcontaining the specified row keys. Row keys must be nonnegative numbers.- Parameters:
rowKeys- The row keys to include- Returns:
- A new
WritableRowSetcontaining the specified row keys
-
fromKeys
Produce aWritableRowSetcontaining a single row key. Row keys must be nonnegative numbers.- Parameters:
rowKey- The row key to include- Returns:
- A new
WritableRowSetcontaining the specified row key
-
fromRange
Create aWritableRowSetcontaining the continuous range [firstRowKey, lastRowKey].- Parameters:
firstRowKey- The first row key in the continuous rangelastRowKey- The last row key in the continuous range- Returns:
- A new
WritableRowSetcontaining the specified row key range
-
flat
- Parameters:
size- The size of theWritableRowSetto create- Returns:
- A flat
WritableRowSetcontaining the row key range[0, size)or anempty row setif thesize <= 0
-
builderRandom
- Returns:
- A
RowSetBuilderRandomsuitable for inserting row keys and row key ranges in no particular order
-
builderSequential
- Returns:
- A
RowSetBuilderRandomoptimized for inserting row keys and row key ranges sequentially in order
-
unionInsert
Constructs a new combinedWritableRowSetfrom the union ofrowSets.When considering the
RowSet.isNonempty()elements, if none exist,empty()will be returned; if only one exist,RowSet.copy()will be returned; otherwise, a new row set will be returned based on theinsertionof all the row sets.This method may perform best when the
rowSetsare ordered and non-overlapping.- Parameters:
rowSets- the input row sets- Returns:
- the new row set
-