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
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 Summary
ConstructorsModifierConstructorDescriptionprotectedTupleMapSetKernel(@NotNull ColumnSource<?>[] keySources, it.unimi.dsi.fastutil.Hash.Strategy<Object> strategy) -
Method Summary
Modifier and TypeMethodDescriptionprotected final booleanprotected abstract booleanexportTuples(@NotNull it.unimi.dsi.fastutil.objects.ObjectIterator<Object> tuples, int @NotNull [] columns, @NotNull WritableChunk<Values>[] keyChunks) Copy the columnscolumnsof the next tuples oftuples, keys in the set, intokeyChunks, as many as fit: columncolumns[ii]into chunkii.protected abstract voidmatchValues(@NotNull Chunk<Values>[] keyChunks, @NotNull LongChunk<OrderedRowKeys> rowKeys, @NotNull WritableLongChunk<OrderedRowKeys> results, boolean inclusion) Select the row keys whose key is in the set, or, ifinclusionis false, not in the set.
-
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 primitivesstrategy- Hashes and compares the tupleskeySourcesmake, and the subclass's probes
-
-
Method Details
-
contains
- 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 columnscolumnsof the next tuples oftuples, keys in the set, intokeyChunks, as many as fit: columncolumns[ii]into chunkii. 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, ifinclusionis 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 arerowKeys- The row key of each rowresults- Receives the selected row keysinclusion- Whether to select the rows whose key is in the set rather than those whose key is not
-