Class DataIndexUtils
java.lang.Object
io.deephaven.engine.table.impl.dataindex.DataIndexUtils
Tools for working with
data indices.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAKeyedObjectKeythat for values keyed by a lookup key. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ToLongFunction<Object> buildRowKeyMappingFunction(Table indexTable, String[] keyColumnNames) Build a mapping function from the lookup keys of the provided indexTableto row keys in the table.static inthashLookupKey(@Nullable Object key) Compute the hash code for a data indexlookupkey.static booleanlookupKeysEqual(@Nullable Object key1, @Nullable Object key2) Test equality between two data indexlookupkeys.static voidlookupRowKeysBoxed(DataIndex.RowKeyLookup lookup, @NotNull Chunk<? extends Values>[] keyChunks, @NotNull WritableLongChunk<RowKeys> rowKeys, boolean usePrev) ImplementDataIndex.RowKeyLookup.apply(Chunk[], WritableLongChunk, boolean)by boxing each key and callingDataIndex.RowKeyLookup.apply(Object, boolean)onlookup, for implementations that cannot search a chunk of keys at once.static ChunkSource.WithPrev<Values> makeBoxedKeySource(@NotNull ColumnSource<?>... keySources) static DataIndexKeySetmakeKeySet(int keyColumnCount) static DataIndexKeySetmakeKeySet(int keyColumnCount, int initialCapacity)
-
Constructor Details
-
DataIndexUtils
public DataIndexUtils()
-
-
Method Details
-
makeBoxedKeySource
public static ChunkSource.WithPrev<Values> makeBoxedKeySource(@NotNull @NotNull ColumnSource<?>... keySources) - Parameters:
keySources- The individual key sources- Returns:
- The boxed key source
-
makeKeySet
- Parameters:
keyColumnCount- The number of key components- Returns:
- The key set
-
makeKeySet
- Parameters:
keyColumnCount- The number of key componentsinitialCapacity- The initial capacity- Returns:
- The key set
-
lookupKeysEqual
public static boolean lookupKeysEqual(@Nullable @Nullable Object key1, @Nullable @Nullable Object key2) Test equality between two data indexlookupkeys.- Returns:
- Whether the two keys are equal
-
hashLookupKey
Compute the hash code for a data indexlookupkey.- Parameters:
key- The lookup key- Returns:
- The hash code
-
lookupRowKeysBoxed
public static void lookupRowKeysBoxed(@NotNull DataIndex.RowKeyLookup lookup, @NotNull @NotNull Chunk<? extends Values>[] keyChunks, @NotNull @NotNull WritableLongChunk<RowKeys> rowKeys, boolean usePrev) ImplementDataIndex.RowKeyLookup.apply(Chunk[], WritableLongChunk, boolean)by boxing each key and callingDataIndex.RowKeyLookup.apply(Object, boolean)onlookup, for implementations that cannot search a chunk of keys at once.- Parameters:
lookup- The lookup to call for each keykeyChunks- The lookup keys, one chunk per key column, at least one, all the same sizerowKeys- Receives the result row key of each lookup key; its size is set to the number of keysusePrev- Whether to look up the keys in previous space
-
buildRowKeyMappingFunction
public static ToLongFunction<Object> buildRowKeyMappingFunction(Table indexTable, String[] keyColumnNames) Build a mapping function from the lookup keys of the provided indexTableto row keys in the table.- Parameters:
indexTable- TheTableto searchkeyColumnNames- The key columns to search- Returns:
- A mapping function from lookup keys to
indexTablerow keys
-