Package io.deephaven.engine.table.impl
Class NaturalJoinModifiedSlotTracker
java.lang.Object
io.deephaven.engine.table.impl.NaturalJoinModifiedSlotTracker
A tracker for modified join hash table slots.
After adding an entry, you get back a cookie, which must be passed in on future modification operations for that
slot.
To process the entries after modifications are complete, call
forAllModifiedSlots(ModifiedSlotConsumer).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final bytethe slot has accumulated left row keys to add (inslotLeftRowSetBuilders)static final bytethe slot has accumulated left row keys to remove (inslotLeftRowSetBuilders)static final intstatic final bytestatic final bytestatic final bytestatic final byte -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongaddLeftAddition(long cookie, int slot, long addedRowKey, long rightValue) Accumulate a left row key that must be added toslot.longaddLeftRemoval(long cookie, int slot, long removedRowKey, long rightValue) Accumulate a left row key that must be removed fromslot.longaddMain(long cookie, int slot, long originalRightValue, byte flags) Add a slot in the main table.voidFor each slot that has accumulated left additions, build the added-key row set and pass it to the consumer, then discard the slot's builder and clear itsFLAG_LEFT_ADDflag (so the finalforAllModifiedSlots(ModifiedSlotConsumer)pass does not re-process it).voidFor each slot that has accumulated left removals, build the removed-key row set and pass it to the consumer, then discard the slot's builder and clear itsFLAG_LEFT_REMOVEflag (so a subsequent removal pass and the finalforAllModifiedSlots(ModifiedSlotConsumer)pass do not re-process it).voidmoveTableLocation(long cookie, int oldTableLocation, int newTableLocation) Move a main table location.
-
Field Details
-
FLAG_MASK
public static final int FLAG_MASK- See Also:
-
FLAG_RIGHT_SHIFT
public static final byte FLAG_RIGHT_SHIFT- See Also:
-
FLAG_RIGHT_MODIFY_PROBE
public static final byte FLAG_RIGHT_MODIFY_PROBE- See Also:
-
FLAG_RIGHT_CHANGE
public static final byte FLAG_RIGHT_CHANGE- See Also:
-
FLAG_RIGHT_ADD
public static final byte FLAG_RIGHT_ADD- See Also:
-
FLAG_LEFT_REMOVE
public static final byte FLAG_LEFT_REMOVEthe slot has accumulated left row keys to remove (inslotLeftRowSetBuilders)- See Also:
-
FLAG_LEFT_ADD
public static final byte FLAG_LEFT_ADDthe slot has accumulated left row keys to add (inslotLeftRowSetBuilders)- See Also:
-
-
Constructor Details
-
NaturalJoinModifiedSlotTracker
public NaturalJoinModifiedSlotTracker()
-
-
Method Details
-
addMain
public long addMain(long cookie, int slot, long originalRightValue, byte flags) Add a slot in the main table.- Parameters:
slot- the slot to add.originalRightValue- if we are the addition of the slot, what the right value was before our modification (otherwise ignored)flags- the flags to or into our state- Returns:
- the cookie for future access
-
addLeftRemoval
public long addLeftRemoval(long cookie, int slot, long removedRowKey, long rightValue) Accumulate a left row key that must be removed fromslot. The removal is not performed here; the key is appended to the slot's sequential builder and theFLAG_LEFT_REMOVEflag is set. The caller performs the removals in bulk later viaforAllLeftRemovals(LeftRowSetConsumer).- Parameters:
cookie- the slot's existing cookie (or an invalid cookie if this slot has not been tracked yet)slot- the hash slot (encoding main/alternate via the insert mask)removedRowKey- the left row key to remove from the slotrightValue- the slot's current right state, used as the original right value if we must allocate an entry- Returns:
- the cookie for future access
-
addLeftAddition
public long addLeftAddition(long cookie, int slot, long addedRowKey, long rightValue) Accumulate a left row key that must be added toslot. The insertion is not performed here; the key is appended to the slot's sequential builder and theFLAG_LEFT_ADDflag is set. The caller performs the insertions in bulk later viaforAllLeftAdditions(LeftRowSetConsumer).- Parameters:
cookie- the slot's existing cookie (or an invalid cookie if this slot has not been tracked yet)slot- the hash slot (encoding main/alternate via the insert mask)addedRowKey- the left row key to add to the slotrightValue- the slot's current right state, used as the original right value if we must allocate an entry- Returns:
- the cookie for future access
-
moveTableLocation
public void moveTableLocation(long cookie, int oldTableLocation, int newTableLocation) Move a main table location.- Parameters:
oldTableLocation- the old hash slotnewTableLocation- the new hash slot
-
forAllLeftRemovals
For each slot that has accumulated left removals, build the removed-key row set and pass it to the consumer, then discard the slot's builder and clear itsFLAG_LEFT_REMOVEflag (so a subsequent removal pass and the finalforAllModifiedSlots(ModifiedSlotConsumer)pass do not re-process it). The row set handed to the consumer is owned by this method and closed after the consumer returns.- Parameters:
consumer- the consumer of each slot's removed left row keys
-
forAllLeftAdditions
For each slot that has accumulated left additions, build the added-key row set and pass it to the consumer, then discard the slot's builder and clear itsFLAG_LEFT_ADDflag (so the finalforAllModifiedSlots(ModifiedSlotConsumer)pass does not re-process it). The row set handed to the consumer is owned by this method and closed after the consumer returns.- Parameters:
consumer- the consumer of each slot's added left row keys
-