Class OperatorAggregationStateManagerOpenAddressedAlternateBase
java.lang.Object
io.deephaven.engine.table.impl.by.OperatorAggregationStateManagerOpenAddressedAlternateBase
- Direct Known Subclasses:
IncrementalChunkedOperatorAggregationStateManagerOpenAddressedBase
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static interface
static interface
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ColumnSource[]
The keys for our hash entries, for the old alternative smaller table.protected int
The number of slots in our alternate table, to start with "1" is a lie, but rehashPointer is zero; so our location value is positive and can be compared against rehashPointer safelystatic final int
protected boolean
Should we rehash the entire table fully (true
) or incrementally (false
)?protected final WritableColumnSource[]
The keys for our hash entries.protected long
protected int
How much of the alternate sources are necessary to rehash?protected int
The number of slots in our table.static final int
-
Constructor Summary
ModifierConstructorDescriptionprotected
OperatorAggregationStateManagerOpenAddressedAlternateBase
(ColumnSource<?>[] tableKeySources, int tableSize, double maximumLoadFactor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(SafeCloseable bc, RowSequence rowSequence, ColumnSource<?>[] sources, org.apache.commons.lang3.mutable.MutableInt nextOutputPosition, WritableIntChunk<RowKeys> outputPositions) protected abstract void
build
(RowSequence rowSequence, Chunk<Values>[] sourceKeyChunks) protected void
buildTable
(OperatorAggregationStateManagerOpenAddressedAlternateBase.BuildContext bc, RowSequence buildRows, ColumnSource<?>[] buildSources, OperatorAggregationStateManagerOpenAddressedAlternateBase.BuildHandler buildHandler) protected void
boolean
doRehash
(org.apache.commons.lang3.mutable.MutableInt rehashCredits, int nextChunkSize) abstract int
findPositionForKey
(Object key) protected int
hashToTableLocation
(int hash) protected int
hashToTableLocationAlternate
(int hash) makeAggregationStateBuildContext
(ColumnSource<?>[] buildSources, long maxSize) makeProbeContext
(ColumnSource<?>[] buildSources, long maxSize) final int
protected abstract void
protected abstract void
protected abstract void
onNextChunk
(int nextChunkSize) protected void
probeTable
(TypedHasherUtil.BuildOrProbeContext.ProbeContext pc, RowSequence probeRows, boolean usePrev, ColumnSource<?>[] probeSources, OperatorAggregationStateManagerOpenAddressedAlternateBase.ProbeHandler handler) protected abstract void
rehashInternalFull
(int oldSize) protected abstract int
rehashInternalPartial
(int numEntriesToRehash) boolean
rehashRequired
(int nextChunkSize)
-
Field Details
-
CHUNK_SIZE
public static final int CHUNK_SIZE -
tableSize
protected int tableSizeThe number of slots in our table. -
alternateTableSize
protected int alternateTableSizeThe number of slots in our alternate table, to start with "1" is a lie, but rehashPointer is zero; so our location value is positive and can be compared against rehashPointer safely -
fullRehash
protected boolean fullRehashShould we rehash the entire table fully (true
) or incrementally (false
)? -
rehashPointer
protected int rehashPointerHow much of the alternate sources are necessary to rehash? -
numEntries
protected long numEntries -
mainKeySources
The keys for our hash entries. -
alternateKeySources
The keys for our hash entries, for the old alternative smaller table. -
UNKNOWN_ROW
static final int UNKNOWN_ROW- See Also:
-
-
Constructor Details
-
OperatorAggregationStateManagerOpenAddressedAlternateBase
protected OperatorAggregationStateManagerOpenAddressedAlternateBase(ColumnSource<?>[] tableKeySources, int tableSize, double maximumLoadFactor)
-
-
Method Details
-
maxTableSize
public final int maxTableSize() -
build
-
makeProbeContext
public TypedHasherUtil.BuildOrProbeContext.ProbeContext makeProbeContext(ColumnSource<?>[] buildSources, long maxSize) -
onNextChunk
protected abstract void onNextChunk(int nextChunkSize) -
buildTable
protected void buildTable(OperatorAggregationStateManagerOpenAddressedAlternateBase.BuildContext bc, RowSequence buildRows, ColumnSource<?>[] buildSources, OperatorAggregationStateManagerOpenAddressedAlternateBase.BuildHandler buildHandler) -
migrateFront
protected abstract void migrateFront() -
probeTable
protected void probeTable(TypedHasherUtil.BuildOrProbeContext.ProbeContext pc, RowSequence probeRows, boolean usePrev, ColumnSource<?>[] probeSources, OperatorAggregationStateManagerOpenAddressedAlternateBase.ProbeHandler handler) -
doRehash
public boolean doRehash(org.apache.commons.lang3.mutable.MutableInt rehashCredits, int nextChunkSize) - Parameters:
rehashCredits
- the number of entries this operation has rehashed (input/output)nextChunkSize
- the size of the chunk we are processing- Returns:
- true if a front migration is required
-
newAlternate
protected abstract void newAlternate() -
clearAlternate
protected void clearAlternate() -
rehashInternalPartial
protected abstract int rehashInternalPartial(int numEntriesToRehash) - Parameters:
numEntriesToRehash
- number of entries to rehash into main table- Returns:
- actual number of entries rehashed
-
rehashInternalFull
protected abstract void rehashInternalFull(int oldSize) -
rehashRequired
public boolean rehashRequired(int nextChunkSize) -
hashToTableLocation
protected int hashToTableLocation(int hash) -
hashToTableLocationAlternate
protected int hashToTableLocationAlternate(int hash) -
findPositionForKey
-
makeAggregationStateBuildContext
-
add
void add(SafeCloseable bc, RowSequence rowSequence, ColumnSource<?>[] sources, org.apache.commons.lang3.mutable.MutableInt nextOutputPosition, WritableIntChunk<RowKeys> outputPositions) -
getKeyHashTableSources
ColumnSource[] getKeyHashTableSources()
-