Class DataIndexUtils

java.lang.Object
io.deephaven.engine.table.impl.dataindex.DataIndexUtils

public class DataIndexUtils extends Object
Tools for working with data indices.
  • Constructor Details

    • DataIndexUtils

      public DataIndexUtils()
  • Method Details

    • makeBoxedKeySource

      public static ChunkSource.WithPrev<Values> makeBoxedKeySource(@NotNull @NotNull ColumnSource<?>... keySources)
      Make a ChunkSource that produces data index lookup keys from keySources.
      Parameters:
      keySources - The individual key sources
      Returns:
      The boxed key source
    • makeKeySet

      public static DataIndexKeySet makeKeySet(int keyColumnCount)
      Make a DataIndexKeySet that stores data index lookup keys that have keyColumnCount components.
      Parameters:
      keyColumnCount - The number of key components
      Returns:
      The key set
    • makeKeySet

      public static DataIndexKeySet makeKeySet(int keyColumnCount, int initialCapacity)
      Make a DataIndexKeySet that stores data index lookup keys that have keyColumnCount components.
      Parameters:
      keyColumnCount - The number of key components
      initialCapacity - 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 index lookup keys.
      Returns:
      Whether the two keys are equal
    • hashLookupKey

      public static int hashLookupKey(@Nullable @Nullable Object key)
      Compute the hash code for a data index lookup key.
      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)
      Implement DataIndex.RowKeyLookup.apply(Chunk[], WritableLongChunk, boolean) by boxing each key and calling DataIndex.RowKeyLookup.apply(Object, boolean) on lookup, for implementations that cannot search a chunk of keys at once.
      Parameters:
      lookup - The lookup to call for each key
      keyChunks - The lookup keys, one chunk per key column, at least one, all the same size
      rowKeys - Receives the result row key of each lookup key; its size is set to the number of keys
      usePrev - 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 index Table to row keys in the table.
      Parameters:
      indexTable - The Table to search
      keyColumnNames - The key columns to search
      Returns:
      A mapping function from lookup keys to indexTable row keys