Class DataIndexer
java.lang.Object
io.deephaven.engine.table.impl.indexer.DataIndexer
- All Implemented Interfaces:
TrackingRowSet.Indexer
Indexer that provides single and multi-column clustering indexes for a table, linked to a
TrackingRowSet
.- ApiNote:
- DataIndexers should not be used after the host
TrackingRowSet
has beenclosed
.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDataIndex
(@NotNull DataIndex dataIndex) Add aDataIndex
to this DataIndexer.dataIndexes
(boolean ensureValidAndLive) static DataIndexer
existingOf
(@NotNull TrackingRowSet rowSet) DataIndexer lookup method.getDataIndex
(@NotNull ColumnSource<?>... keyColumns) Return aDataIndex
for the given key columns, ornull
if no such index exists, if the cached index is invalid, or if therefreshing
cached index is no longer live.static @Nullable DataIndex
getDataIndex
(@NotNull Table table, String... keyColumnNames) Iftable
has a DataIndexer, return aDataIndex
for the given key columns, ornull
if no such index exists, if the cached index is invalid, or if therefreshing
cached index is no longer live.static @Nullable DataIndex
getDataIndex
(@NotNull Table table, Collection<String> keyColumnNames) Iftable
has a DataIndexer, return aDataIndex
for the given key columns, ornull
if no such index exists, if the cached index is invalid, or if therefreshing
cached index is no longer live.getDataIndex
(@NotNull Collection<ColumnSource<?>> keyColumns) Return aDataIndex
for the given key columns, ornull
if no such index exists, if the cached index is invalid, or if therefreshing
cached index is no longer live.static @Nullable DataIndex
getOptimalPartialIndex
(Table table, String... keyColumnNames) Return a valid, liveDataIndex
for a strict subset of the given key columns, ornull
if no such index exists.static DataIndex
getOrCreateDataIndex
(@NotNull Table table, @NotNull String... keyColumnNames) Create aDataIndex
fortable
indexingkeyColumns
, if no valid, live data index already exists for these inputs.static DataIndex
getOrCreateDataIndex
(@NotNull Table table, @NotNull Collection<String> keyColumnNames) Create aDataIndex
fortable
indexingkeyColumns
, if no valid, live data index already exists for these inputs.boolean
hasDataIndex
(@NotNull ColumnSource<?>... keyColumns) Test whether this DataIndexer has a usableDataIndex
for the given key columns.static boolean
hasDataIndex
(@NotNull Table table, @NotNull String... keyColumnNames) Test whethertable
has a DataIndexer with a usableDataIndex
for the given key columns.static boolean
hasDataIndex
(@NotNull Table table, @NotNull Collection<String> keyColumnNames) Test whethertable
has a DataIndexer with a usableDataIndex
for the given key columns.boolean
hasDataIndex
(@NotNull Collection<ColumnSource<?>> keyColumns) Test whether this DataIndexer has a usableDataIndex
for the given key columns.static DataIndexer
of
(@NotNull TrackingRowSet rowSet) DataIndexer factory method.
-
Method Details
-
existingOf
DataIndexer lookup method. Use this call when you will query from the returned DataIndexer but not add new ones.- Parameters:
rowSet
- The row set to index- Returns:
- The DataIndexer for
rowSet
, or null if none exists
-
of
DataIndexer factory method. Use this call when you will add indexes to the returned DataIndexer.- Parameters:
rowSet
- The row set to index- Returns:
- The DataIndexer for
rowSet
, created by this call if necessary
-
hasDataIndex
public static boolean hasDataIndex(@NotNull @NotNull Table table, @NotNull @NotNull String... keyColumnNames) Test whethertable
has a DataIndexer with a usableDataIndex
for the given key columns. Note that a result from this method is a snapshot of current state, and does not guarantee anything about future calls tohasDataIndex(io.deephaven.engine.table.Table, java.lang.String...)
,getDataIndex(io.deephaven.engine.table.Table, java.lang.String...)
, orgetOrCreateDataIndex(Table, String...)
. -
hasDataIndex
public static boolean hasDataIndex(@NotNull @NotNull Table table, @NotNull @NotNull Collection<String> keyColumnNames) Test whethertable
has a DataIndexer with a usableDataIndex
for the given key columns. Note that a result from this method is a snapshot of current state, and does not guarantee anything about future calls tohasDataIndex(io.deephaven.engine.table.Table, java.lang.String...)
,getDataIndex(io.deephaven.engine.table.Table, java.lang.String...)
, orgetOrCreateDataIndex(Table, String...)
. -
hasDataIndex
Test whether this DataIndexer has a usableDataIndex
for the given key columns. Note that a result from this method is a snapshot of current state, and does not guarantee anything about future calls tohasDataIndex(io.deephaven.engine.table.Table, java.lang.String...)
,getDataIndex(io.deephaven.engine.table.Table, java.lang.String...)
, orgetOrCreateDataIndex(Table, String...)
.- Parameters:
keyColumns
- The key columns to check- Returns:
- Whether this DataIndexer has a
DataIndex
for the given key columns
-
hasDataIndex
Test whether this DataIndexer has a usableDataIndex
for the given key columns. Note that a result from this method is a snapshot of current state, and does not guarantee anything about future calls tohasDataIndex(io.deephaven.engine.table.Table, java.lang.String...)
,getDataIndex(io.deephaven.engine.table.Table, java.lang.String...)
, orgetOrCreateDataIndex(Table, String...)
.- Parameters:
keyColumns
- The key columns to check- Returns:
- Whether this DataIndexer has a
DataIndex
for the given key columns
-
getDataIndex
@Nullable public static @Nullable DataIndex getDataIndex(@NotNull @NotNull Table table, String... keyColumnNames) Iftable
has a DataIndexer, return aDataIndex
for the given key columns, ornull
if no such index exists, if the cached index is invalid, or if therefreshing
cached index is no longer live. -
getDataIndex
@Nullable public static @Nullable DataIndex getDataIndex(@NotNull @NotNull Table table, Collection<String> keyColumnNames) Iftable
has a DataIndexer, return aDataIndex
for the given key columns, ornull
if no such index exists, if the cached index is invalid, or if therefreshing
cached index is no longer live. -
getDataIndex
Return aDataIndex
for the given key columns, ornull
if no such index exists, if the cached index is invalid, or if therefreshing
cached index is no longer live.- Parameters:
keyColumns
- Thecolumn sources
for which to retrieve aDataIndex
- Returns:
- The
DataIndex
, ornull
if one does not exist
-
getDataIndex
Return aDataIndex
for the given key columns, ornull
if no such index exists, if the cached index is invalid, or if therefreshing
cached index is no longer live.- Parameters:
keyColumns
- Thecolumn sources
for which to retrieve aDataIndex
- Returns:
- The
DataIndex
, ornull
if one does not exist
-
getOptimalPartialIndex
@Nullable public static @Nullable DataIndex getOptimalPartialIndex(Table table, String... keyColumnNames) Return a valid, liveDataIndex
for a strict subset of the given key columns, ornull
if no such index exists. Will choose the DataIndex that results in the largest index table, following the assumption that the largest index table will divide the source table into the most specific partitions. -
getOrCreateDataIndex
public static DataIndex getOrCreateDataIndex(@NotNull @NotNull Table table, @NotNull @NotNull String... keyColumnNames) Create aDataIndex
fortable
indexingkeyColumns
, if no valid, live data index already exists for these inputs. -
getOrCreateDataIndex
public static DataIndex getOrCreateDataIndex(@NotNull @NotNull Table table, @NotNull @NotNull Collection<String> keyColumnNames) Create aDataIndex
fortable
indexingkeyColumns
, if no valid, live data index already exists for these inputs. -
addDataIndex
Add aDataIndex
to this DataIndexer.- Parameters:
dataIndex
- TheDataIndex
to add- Throws:
IllegalStateException
- If a valid, liveDataIndex
already exists for the given key columns
-
dataIndexes
- Parameters:
ensureValidAndLive
- Whether to ensure that returnedDataIndexes
are valid and live- Returns:
- All the
DataIndexes
in this DataIndexer
-