Class DataIndexer
- All Implemented Interfaces:
TrackingRowSet.Indexer
TrackingRowSet.- ApiNote:
- DataIndexers should not be used after the host
TrackingRowSethas beenclosed.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface forDataIndeximplementations that may opt into strong reachability within the DataIndexer's cache. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDataIndex(@NotNull DataIndex dataIndex) Add aDataIndexto this DataIndexer.dataIndexes(boolean ensureValidAndLive) static DataIndexerexistingOf(@NotNull TrackingRowSet rowSet) DataIndexer lookup method.getCompatibleDataIndexes(@NotNull Collection<ColumnSource<?>> keyColumns) Get a list of all theDataIndexesin this DataIndexer that contain the supplied key columns.getDataIndex(@NotNull ColumnSource<?>... keyColumns) Return aDataIndexfor the given key columns, ornullif no such index exists, if the cached index is invalid, or if therefreshingcached index is no longer live.static @Nullable DataIndexgetDataIndex(@NotNull Table table, String... keyColumnNames) Iftablehas a DataIndexer, return aDataIndexfor the given key columns, ornullif no such index exists, if the cached index is invalid, or if therefreshingcached index is no longer live.static @Nullable DataIndexgetDataIndex(@NotNull Table table, Collection<String> keyColumnNames) Iftablehas a DataIndexer, return aDataIndexfor the given key columns, ornullif no such index exists, if the cached index is invalid, or if therefreshingcached index is no longer live.getDataIndex(@NotNull Collection<ColumnSource<?>> keyColumns) Return aDataIndexfor the given key columns, ornullif no such index exists, if the cached index is invalid, or if therefreshingcached index is no longer live.static DataIndexgetOrCreateDataIndex(@NotNull Table table, @NotNull String... keyColumnNames) Create aDataIndexfortableindexingkeyColumns, if no valid, live data index already exists for these inputs.static DataIndexgetOrCreateDataIndex(@NotNull Table table, @NotNull Collection<String> keyColumnNames) Create aDataIndexfortableindexingkeyColumns, if no valid, live data index already exists for these inputs.booleanhasDataIndex(@NotNull ColumnSource<?>... keyColumns) Test whether this DataIndexer has a usableDataIndexfor the given key columns.static booleanhasDataIndex(@NotNull Table table, @NotNull String... keyColumnNames) Test whethertablehas a DataIndexer with a usableDataIndexfor the given key columns.static booleanhasDataIndex(@NotNull Table table, @NotNull Collection<String> keyColumnNames) Test whethertablehas a DataIndexer with a usableDataIndexfor the given key columns.booleanhasDataIndex(@NotNull Collection<ColumnSource<?>> keyColumns) Test whether this DataIndexer has a usableDataIndexfor the given key columns.static DataIndexerof(@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 whethertablehas a DataIndexer with a usableDataIndexfor 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 whethertablehas a DataIndexer with a usableDataIndexfor 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 usableDataIndexfor 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
DataIndexfor the given key columns
-
hasDataIndex
Test whether this DataIndexer has a usableDataIndexfor 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
DataIndexfor the given key columns
-
getDataIndex
@Nullable public static @Nullable DataIndex getDataIndex(@NotNull @NotNull Table table, String... keyColumnNames) Iftablehas a DataIndexer, return aDataIndexfor the given key columns, ornullif no such index exists, if the cached index is invalid, or if therefreshingcached index is no longer live. -
getDataIndex
@Nullable public static @Nullable DataIndex getDataIndex(@NotNull @NotNull Table table, Collection<String> keyColumnNames) Iftablehas a DataIndexer, return aDataIndexfor the given key columns, ornullif no such index exists, if the cached index is invalid, or if therefreshingcached index is no longer live. -
getDataIndex
Return aDataIndexfor the given key columns, ornullif no such index exists, if the cached index is invalid, or if therefreshingcached index is no longer live.- Parameters:
keyColumns- Thecolumn sourcesfor which to retrieve aDataIndex- Returns:
- The
DataIndex, ornullif one does not exist
-
getDataIndex
Return aDataIndexfor the given key columns, ornullif no such index exists, if the cached index is invalid, or if therefreshingcached index is no longer live.- Parameters:
keyColumns- Thecolumn sourcesfor which to retrieve aDataIndex- Returns:
- The
DataIndex, ornullif one does not exist
-
getCompatibleDataIndexes
@NotNull public @NotNull List<DataIndex> getCompatibleDataIndexes(@NotNull @NotNull Collection<ColumnSource<?>> keyColumns) Get a list of all theDataIndexesin this DataIndexer that contain the supplied key columns. This will return indexes with key columns that are supersets of the supplied key columns.- Parameters:
keyColumns- Thecolumn sourcesfor which to retrievedata indexes- Returns:
- All the
DataIndexesin this DataIndexer
-
getOrCreateDataIndex
public static DataIndex getOrCreateDataIndex(@NotNull @NotNull Table table, @NotNull @NotNull String... keyColumnNames) Create aDataIndexfortableindexingkeyColumns, if no valid, live data index already exists for these inputs.The returned index's
tablemay not becached; it is created when first requested. Some operations, such aswhere, use only data indexes whose tables are cached, and do not create them. To ensure that the table is cached, the caller must callBasicDataIndex.table()on the returned index. The index retains its table once created, but this DataIndexer may reference the index only weakly, so the caller must keep the index reachable and live for as long as other operations should find it with its table cached. -
getOrCreateDataIndex
public static DataIndex getOrCreateDataIndex(@NotNull @NotNull Table table, @NotNull @NotNull Collection<String> keyColumnNames) Create aDataIndexfortableindexingkeyColumns, if no valid, live data index already exists for these inputs.The returned index's
tablemay not becached; it is created when first requested. Some operations, such aswhere, use only data indexes whose tables are cached, and do not create them. To ensure that the table is cached, the caller must callBasicDataIndex.table()on the returned index. The index retains its table once created, but this DataIndexer may reference the index only weakly, so the caller must keep the index reachable and live for as long as other operations should find it with its table cached. -
addDataIndex
Add aDataIndexto this DataIndexer.- Parameters:
dataIndex- TheDataIndexto add- Throws:
IllegalStateException- If a valid, liveDataIndexalready exists for the given key columns
-
dataIndexes
- Parameters:
ensureValidAndLive- Whether to ensure that returnedDataIndexesare valid and live- Returns:
- All the
DataIndexesin this DataIndexer
-