Package io.deephaven.engine.table
Interface DataIndex.RowKeyLookup
- Enclosing interface:
DataIndex
public static interface DataIndex.RowKeyLookup
Provides a lookup function from a lookup key to the row key in the index table. Lookup keys consist of
reinterpreted values and are specified as follows:
- No key columns
- "Empty" keys are signified by any zero-length
Object[], and are looked up one at a time; the chunkedapplyneeds a key column to give the number of keys - One key column
- Singular keys are (boxed, if needed) objects
- Multiple key columns
- Compound keys are
Object[]of (boxed, if needed) objects, in the order of the index's key columns
-
Method Summary
Modifier and TypeMethodDescriptionvoidapply(@NotNull Chunk<? extends Values>[] keyChunks, @NotNull WritableLongChunk<RowKeys> rowKeys, boolean usePrev) Get the row key in the index table for each of a chunk of lookup keys, given one chunk per key column in the order of the index's key columns, each reinterpreted as forapply(Object, boolean).longGet the row key in the index table for the provided lookup key.default longThe step on which the index last began changing the structure its lookups read, recorded before the change, orQueryConstants.NULL_LONGif it never changes.
-
Method Details
-
apply
Get the row key in the index table for the provided lookup key.- Parameters:
key- The key to lookup- Returns:
- The result row key, or
RowSequence.NULL_ROW_KEYif the key is not found.
-
apply
void apply(@NotNull @NotNull Chunk<? extends Values>[] keyChunks, @NotNull @NotNull WritableLongChunk<RowKeys> rowKeys, boolean usePrev) Get the row key in the index table for each of a chunk of lookup keys, given one chunk per key column in the order of the index's key columns, each reinterpreted as forapply(Object, boolean). The index must have at least one key column, whose chunk gives the number of keys.Implementations that cannot search a chunk of keys at once may delegate to
io.deephaven.engine.table.impl.dataindex.DataIndexUtils.lookupRowKeysBoxed, which boxes each key and callsapply(Object, boolean).- Parameters:
keyChunks- The lookup keys, one chunk per key column, at least one, all the same sizerowKeys- Receives the result row key of each lookup key, orRowSequence.NULL_ROW_KEYfor a key that is not found; its size is set to the number of keysusePrev- Whether to look up the keys in previous space
-
lastStateChangeStep
default long lastStateChangeStep()The step on which the index last began changing the structure its lookups read, recorded before the change, orQueryConstants.NULL_LONGif it never changes. Calling this orders the lookups made before it ahead of reading the step.A refreshing index may change that structure while a reader that is not on the update graph thread uses it. Such a reader reads its step from the update graph's clock before its lookups, and this after them. Compared to the reader's step, this is:
- less: the lookups answered for the index's state at the reader's step, previous and current alike;
- equal: the lookups may not have answered for the previous state, and answered for the current state if the reader waited for the index to be satisfied at its step;
- greater: the lookups may not have answered for either state at the reader's step.
- Returns:
- The step on which the index last began changing the structure its lookups read
-