Class TupleMapSetKernel

java.lang.Object
io.deephaven.engine.table.impl.select.TupleMapSetKernel
Direct Known Subclasses:
TupleSetKernelByteByte, TupleSetKernelByteChar, TupleSetKernelByteDouble, TupleSetKernelByteFloat, TupleSetKernelByteInt, TupleSetKernelByteLong, TupleSetKernelByteObject, TupleSetKernelByteShort, TupleSetKernelCharByte, TupleSetKernelCharChar, TupleSetKernelCharDouble, TupleSetKernelCharFloat, TupleSetKernelCharInt, TupleSetKernelCharLong, TupleSetKernelCharObject, TupleSetKernelCharShort, TupleSetKernelDoubleByte, TupleSetKernelDoubleChar, TupleSetKernelDoubleDouble, TupleSetKernelDoubleFloat, TupleSetKernelDoubleInt, TupleSetKernelDoubleLong, TupleSetKernelDoubleObject, TupleSetKernelDoubleShort, TupleSetKernelFloatByte, TupleSetKernelFloatChar, TupleSetKernelFloatDouble, TupleSetKernelFloatFloat, TupleSetKernelFloatInt, TupleSetKernelFloatLong, TupleSetKernelFloatObject, TupleSetKernelFloatShort, TupleSetKernelIntByte, TupleSetKernelIntChar, TupleSetKernelIntDouble, TupleSetKernelIntFloat, TupleSetKernelIntInt, TupleSetKernelIntLong, TupleSetKernelIntObject, TupleSetKernelIntShort, TupleSetKernelLongByte, TupleSetKernelLongChar, TupleSetKernelLongDouble, TupleSetKernelLongFloat, TupleSetKernelLongInt, TupleSetKernelLongLong, TupleSetKernelLongObject, TupleSetKernelLongShort, TupleSetKernelObjectByte, TupleSetKernelObjectChar, TupleSetKernelObjectDouble, TupleSetKernelObjectFloat, TupleSetKernelObjectInt, TupleSetKernelObjectLong, TupleSetKernelObjectObject, TupleSetKernelObjectShort, TupleSetKernelShortByte, TupleSetKernelShortChar, TupleSetKernelShortDouble, TupleSetKernelShortFloat, TupleSetKernelShortInt, TupleSetKernelShortLong, TupleSetKernelShortObject, TupleSetKernelShortShort

public abstract class TupleMapSetKernel extends Object
A SetKernel for a compound key, held as the tuples a TupleSource over the set's key sources makes, in a fastutil open hash map from tuple to count.

A subclass for the key's column types, generated by TupleSetKernelFactory, matches a chunk of keys by setting the fields of one reusable probe from the key chunks for each row, so that no tuple is assembled per row; its Hash.Strategy hashes and compares a probe and a stored tuple alike, by each column's Comparisons. Adding and removing set rows does assemble their tuples, which become the stored keys.

  • Constructor Details

    • TupleMapSetKernel

      protected TupleMapSetKernel(@NotNull @NotNull ColumnSource<?>[] keySources, @NotNull it.unimi.dsi.fastutil.Hash.Strategy<Object> strategy)
      Parameters:
      keySources - The set table's key sources, reinterpreted to primitives
      strategy - Hashes and compares the tuples keySources make, and the subclass's probes
  • Method Details

    • contains

      protected final boolean contains(@NotNull @NotNull Object probe)
      Parameters:
      probe - A probe whose fields hold a key
      Returns:
      Whether the key is in the set
    • exportTuples

      protected abstract boolean exportTuples(@NotNull @NotNull it.unimi.dsi.fastutil.objects.ObjectIterator<Object> tuples, int @NotNull [] columns, @NotNull @NotNull WritableChunk<Values>[] keyChunks)
      Copy the columns columns of the next tuples of tuples, keys in the set, into keyChunks, as many as fit: column columns[ii] into chunk ii. Sets every chunk's size to the number copied.
      Returns:
      Whether any tuple was copied
    • matchValues

      protected abstract void matchValues(@NotNull @NotNull Chunk<Values>[] keyChunks, @NotNull @NotNull LongChunk<OrderedRowKeys> rowKeys, @NotNull @NotNull WritableLongChunk<OrderedRowKeys> results, boolean inclusion)
      Select the row keys whose key is in the set, or, if inclusion is false, not in the set. The kernel keeps no state between calls, so that any number of readers may match at once.
      Parameters:
      keyChunks - The key of each row, one chunk per key column, reinterpreted as the set's keys are
      rowKeys - The row key of each row
      results - Receives the selected row keys
      inclusion - Whether to select the rows whose key is in the set rather than those whose key is not