Class IncrementalNaturalJoinStateManagerTypedBase
java.lang.Object
io.deephaven.engine.table.impl.StaticNaturalJoinStateManager
io.deephaven.engine.table.impl.naturaljoin.IncrementalNaturalJoinStateManagerTypedBase
- All Implemented Interfaces:
BothIncrementalNaturalJoinStateManager
,IncrementalNaturalJoinStateManager
public abstract class IncrementalNaturalJoinStateManagerTypedBase
extends StaticNaturalJoinStateManager
implements IncrementalNaturalJoinStateManager, BothIncrementalNaturalJoinStateManager
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
Nested classes/interfaces inherited from interface io.deephaven.engine.table.impl.BothIncrementalNaturalJoinStateManager
BothIncrementalNaturalJoinStateManager.InitialBuildContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
protected final WritableColumnSource[]
protected ImmutableObjectArraySource<WritableRowSet>
protected ImmutableLongArraySource
protected ImmutableLongArraySource
protected int
protected final ChunkType[]
static final long
protected gnu.trove.list.array.TLongArrayList
protected int
protected final WritableColumnSource[]
protected ImmutableObjectArraySource<WritableRowSet>
protected ImmutableLongArraySource
protected ImmutableLongArraySource
protected long
protected long
protected int
protected ObjectArraySource<WritableRowSet>
protected int
Fields inherited from class io.deephaven.engine.table.impl.StaticNaturalJoinStateManager
DUPLICATE_RIGHT_VALUE, keySourcesForErrorMessages, NO_RIGHT_ENTRY_VALUE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
IncrementalNaturalJoinStateManagerTypedBase
(ColumnSource<?>[] tableKeySources, ColumnSource<?>[] keySourcesForErrorMessages, int tableSize, double maximumLoadFactor) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
addLeftSide
(RowSequence rowSequence, Chunk[] sourceKeyChunks, LongArraySource leftRedirections, long redirectionOffset) void
addLeftSide
(Context bc, RowSequence leftRowSet, ColumnSource<?>[] leftSources, LongArraySource leftRedirections, @NotNull NaturalJoinModifiedSlotTracker modifiedSlotTracker) protected abstract void
addRightSide
(RowSequence rowSequence, Chunk[] sourceKeyChunks, NaturalJoinModifiedSlotTracker modifiedSlotTracker) void
addRightSide
(Context bc, RowSequence rightRowSet, ColumnSource<?>[] rightSources, @NotNull NaturalJoinModifiedSlotTracker modifiedSlotTracker) protected long
protected abstract void
applyLeftShift
(RowSequence rowSequence, Chunk[] sourceKeyChunks, long shiftDelta, IncrementalNaturalJoinStateManagerTypedBase.ProbeContext pc) void
applyLeftShift
(Context pc, ColumnSource<?>[] leftSources, RowSet shiftedRowSet, long shiftDelta) protected abstract void
applyRightShift
(RowSequence rowSequence, Chunk[] sourceKeyChunks, long shiftDelta, NaturalJoinModifiedSlotTracker modifiedSlotTracker, IncrementalNaturalJoinStateManagerTypedBase.ProbeContext pc) void
applyRightShift
(Context pc, ColumnSource<?>[] rightSources, RowSet shiftedRowSet, long shiftDelta, @NotNull NaturalJoinModifiedSlotTracker modifiedSlotTracker) protected abstract void
buildFromLeftSide
(RowSequence rowSequence, Chunk[] sourceKeyChunks) protected abstract void
buildFromRightSide
(RowSequence rowSequence, Chunk[] sourceKeyChunks) void
buildFromRightSide
(Table rightTable, ColumnSource<?>[] rightSources) buildRowRedirectionFromRedirections
(QueryTable leftTable, boolean exactMatch, BothIncrementalNaturalJoinStateManager.InitialBuildContext ibc, JoinControl.RedirectionType redirectionType) protected void
buildTable
(boolean initialBuild, IncrementalNaturalJoinStateManagerTypedBase.BuildContext bc, RowSequence buildRows, ColumnSource<?>[] buildSources, TypedHasherUtil.BuildHandler buildHandler, NaturalJoinModifiedSlotTracker modifiedSlotTracker) protected void
void
void
decorateLeftSide
(RowSet leftRows, ColumnSource<?>[] leftSources, BothIncrementalNaturalJoinStateManager.InitialBuildContext ibc) void
decorateLeftSide
(RowSet leftRowSet, ColumnSource<?>[] leftSources, LongArraySource leftRedirections) boolean
doRehash
(boolean fullRehash, org.apache.commons.lang3.mutable.MutableInt rehashCredits, int nextChunkSize, NaturalJoinModifiedSlotTracker modifiedSlotTracker) protected long
duplicateLocationFromRowKey
(long rowKey) protected void
freeDuplicateLocation
(long duplicateLocation) getLeftIndex
(int slot) long
getRightIndex
(int slot) protected int
hashToTableLocation
(int hash) protected int
hashToTableLocationAlternate
(int hash) keyString
(int slot) makeBuildContext
(ColumnSource<?>[] buildSources, long maxSize) makeProbeContext
(ColumnSource<?>[] buildSources, long maxSize) protected abstract void
migrateFront
(NaturalJoinModifiedSlotTracker modifiedSlotTracker) protected abstract void
modifyByRight
(RowSequence rowSequence, Chunk[] sourceKeyChunks, NaturalJoinModifiedSlotTracker modifiedSlotTracker) void
modifyByRight
(Context pc, RowSet modified, ColumnSource<?>[] rightSources, @NotNull NaturalJoinModifiedSlotTracker modifiedSlotTracker) protected void
protected void
probeTable
(IncrementalNaturalJoinStateManagerTypedBase.ProbeContext pc, RowSequence probeRows, boolean usePrev, ColumnSource<?>[] probeSources, TypedHasherUtil.ProbeHandler handler) protected abstract void
rehashInternalFull
(int oldSize) protected abstract int
rehashInternalPartial
(int numEntriesToRehash, NaturalJoinModifiedSlotTracker modifiedSlotTracker) boolean
rehashRequired
(int nextChunkSize) protected abstract void
removeLeft
(RowSequence rowSequence, Chunk[] sourceKeyChunks) void
removeLeft
(Context pc, RowSequence leftIndex, ColumnSource<?>[] leftSources) protected abstract void
removeRight
(RowSequence rowSequence, Chunk[] sourceKeyChunks, NaturalJoinModifiedSlotTracker modifiedSlotTracker) void
removeRight
(Context pc, RowSequence rightRowSet, ColumnSource<?>[] rightSources, @NotNull NaturalJoinModifiedSlotTracker modifiedSlotTracker) protected long
rowKeyFromDuplicateLocation
(long duplicateLocation) protected void
shiftOneKey
(WritableRowSet existingLeftRowSet, long shiftedKey, long shiftDelta) Methods inherited from class io.deephaven.engine.table.impl.StaticNaturalJoinStateManager
buildRowRedirection, checkExactMatch, extractKeyStringFromSourceTable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.deephaven.engine.table.impl.IncrementalNaturalJoinStateManager
checkExactMatch
-
Field Details
-
EMPTY_RIGHT_STATE
public static final long EMPTY_RIGHT_STATE- See Also:
-
tableSize
protected int tableSize -
alternateTableSize
protected int alternateTableSize -
rehashPointer
protected int rehashPointer -
numEntries
protected long numEntries -
chunkTypes
-
mainKeySources
-
alternateKeySources
-
mainRightRowKey
-
alternateRightRowKey
-
mainLeftRowSet
-
mainModifiedTrackerCookieSource
-
alternateLeftRowSet
-
alternateModifiedTrackerCookieSource
-
rightSideDuplicateRowSets
-
nextDuplicateRightSide
protected long nextDuplicateRightSide -
freeDuplicateValues
protected gnu.trove.list.array.TLongArrayList freeDuplicateValues -
mainInsertMask
protected int mainInsertMask -
alternateInsertMask
protected int alternateInsertMask
-
-
Constructor Details
-
IncrementalNaturalJoinStateManagerTypedBase
protected IncrementalNaturalJoinStateManagerTypedBase(ColumnSource<?>[] tableKeySources, ColumnSource<?>[] keySourcesForErrorMessages, int tableSize, double maximumLoadFactor)
-
-
Method Details
-
makeBuildContext
public IncrementalNaturalJoinStateManagerTypedBase.BuildContext makeBuildContext(ColumnSource<?>[] buildSources, long maxSize) - Specified by:
makeBuildContext
in interfaceBothIncrementalNaturalJoinStateManager
-
makeProbeContext
public IncrementalNaturalJoinStateManagerTypedBase.ProbeContext makeProbeContext(ColumnSource<?>[] buildSources, long maxSize) - Specified by:
makeProbeContext
in interfaceBothIncrementalNaturalJoinStateManager
-
buildTable
protected void buildTable(boolean initialBuild, IncrementalNaturalJoinStateManagerTypedBase.BuildContext bc, RowSequence buildRows, ColumnSource<?>[] buildSources, TypedHasherUtil.BuildHandler buildHandler, NaturalJoinModifiedSlotTracker modifiedSlotTracker) -
probeTable
protected void probeTable(IncrementalNaturalJoinStateManagerTypedBase.ProbeContext pc, RowSequence probeRows, boolean usePrev, ColumnSource<?>[] probeSources, TypedHasherUtil.ProbeHandler handler) -
doRehash
public boolean doRehash(boolean fullRehash, org.apache.commons.lang3.mutable.MutableInt rehashCredits, int nextChunkSize, NaturalJoinModifiedSlotTracker modifiedSlotTracker) - Parameters:
fullRehash
- should we rehash the entire table (if false, we rehash incrementally)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 void newAlternate() -
clearAlternate
protected void clearAlternate() -
rehashRequired
public boolean rehashRequired(int nextChunkSize) -
rehashInternalFull
protected abstract void rehashInternalFull(int oldSize) -
migrateFront
-
rehashInternalPartial
protected abstract int rehashInternalPartial(int numEntriesToRehash, NaturalJoinModifiedSlotTracker modifiedSlotTracker) - Parameters:
numEntriesToRehash
- number of entries to rehash into main table- Returns:
- actual number of entries rehashed
-
hashToTableLocation
protected int hashToTableLocation(int hash) -
hashToTableLocationAlternate
protected int hashToTableLocationAlternate(int hash) -
duplicateLocationFromRowKey
protected long duplicateLocationFromRowKey(long rowKey) -
rowKeyFromDuplicateLocation
protected long rowKeyFromDuplicateLocation(long duplicateLocation) -
allocateDuplicateLocation
protected long allocateDuplicateLocation() -
freeDuplicateLocation
protected void freeDuplicateLocation(long duplicateLocation) -
getRightIndex
public long getRightIndex(int slot) - Specified by:
getRightIndex
in interfaceIncrementalNaturalJoinStateManager
-
getLeftIndex
- Specified by:
getLeftIndex
in interfaceIncrementalNaturalJoinStateManager
-
keyString
- Specified by:
keyString
in interfaceIncrementalNaturalJoinStateManager
-
buildFromRightSide
-
buildRowRedirectionFromRedirections
public WritableRowRedirection buildRowRedirectionFromRedirections(QueryTable leftTable, boolean exactMatch, BothIncrementalNaturalJoinStateManager.InitialBuildContext ibc, JoinControl.RedirectionType redirectionType) - Specified by:
buildRowRedirectionFromRedirections
in interfaceBothIncrementalNaturalJoinStateManager
-
applyRightShift
protected abstract void applyRightShift(RowSequence rowSequence, Chunk[] sourceKeyChunks, long shiftDelta, NaturalJoinModifiedSlotTracker modifiedSlotTracker, IncrementalNaturalJoinStateManagerTypedBase.ProbeContext pc) -
modifyByRight
public void modifyByRight(Context pc, RowSet modified, ColumnSource<?>[] rightSources, @NotNull @NotNull NaturalJoinModifiedSlotTracker modifiedSlotTracker) - Specified by:
modifyByRight
in interfaceBothIncrementalNaturalJoinStateManager
-
modifyByRight
protected abstract void modifyByRight(RowSequence rowSequence, Chunk[] sourceKeyChunks, NaturalJoinModifiedSlotTracker modifiedSlotTracker) -
removeRight
public void removeRight(Context pc, RowSequence rightRowSet, ColumnSource<?>[] rightSources, @NotNull @NotNull NaturalJoinModifiedSlotTracker modifiedSlotTracker) - Specified by:
removeRight
in interfaceBothIncrementalNaturalJoinStateManager
-
removeRight
protected abstract void removeRight(RowSequence rowSequence, Chunk[] sourceKeyChunks, NaturalJoinModifiedSlotTracker modifiedSlotTracker) -
buildFromRightSide
- Specified by:
buildFromRightSide
in interfaceBothIncrementalNaturalJoinStateManager
-
decorateLeftSide
public void decorateLeftSide(RowSet leftRows, ColumnSource<?>[] leftSources, BothIncrementalNaturalJoinStateManager.InitialBuildContext ibc) - Specified by:
decorateLeftSide
in interfaceBothIncrementalNaturalJoinStateManager
-
buildFromLeftSide
-
addRightSide
public void addRightSide(Context bc, RowSequence rightRowSet, ColumnSource<?>[] rightSources, @NotNull @NotNull NaturalJoinModifiedSlotTracker modifiedSlotTracker) - Specified by:
addRightSide
in interfaceBothIncrementalNaturalJoinStateManager
-
addRightSide
protected abstract void addRightSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, NaturalJoinModifiedSlotTracker modifiedSlotTracker) -
addLeftSide
public void addLeftSide(Context bc, RowSequence leftRowSet, ColumnSource<?>[] leftSources, LongArraySource leftRedirections, @NotNull @NotNull NaturalJoinModifiedSlotTracker modifiedSlotTracker) - Specified by:
addLeftSide
in interfaceBothIncrementalNaturalJoinStateManager
-
addLeftSide
protected abstract void addLeftSide(RowSequence rowSequence, Chunk[] sourceKeyChunks, LongArraySource leftRedirections, long redirectionOffset) -
removeLeft
- Specified by:
removeLeft
in interfaceBothIncrementalNaturalJoinStateManager
-
removeLeft
-
applyLeftShift
public void applyLeftShift(Context pc, ColumnSource<?>[] leftSources, RowSet shiftedRowSet, long shiftDelta) - Specified by:
applyLeftShift
in interfaceBothIncrementalNaturalJoinStateManager
-
applyRightShift
public void applyRightShift(Context pc, ColumnSource<?>[] rightSources, RowSet shiftedRowSet, long shiftDelta, @NotNull @NotNull NaturalJoinModifiedSlotTracker modifiedSlotTracker) - Specified by:
applyRightShift
in interfaceBothIncrementalNaturalJoinStateManager
-
shiftOneKey
-
applyLeftShift
protected abstract void applyLeftShift(RowSequence rowSequence, Chunk[] sourceKeyChunks, long shiftDelta, IncrementalNaturalJoinStateManagerTypedBase.ProbeContext pc) -
makeInitialBuildContext
- Specified by:
makeInitialBuildContext
in interfaceBothIncrementalNaturalJoinStateManager
-
decorateLeftSide
public void decorateLeftSide(RowSet leftRowSet, ColumnSource<?>[] leftSources, LongArraySource leftRedirections) - Specified by:
decorateLeftSide
in classStaticNaturalJoinStateManager
-
compactAll
public void compactAll()- Specified by:
compactAll
in interfaceBothIncrementalNaturalJoinStateManager
-