Interface IncrementalNaturalJoinStateManager

All Known Subinterfaces:
BothIncrementalNaturalJoinStateManager
All Known Implementing Classes:
IncrementalNaturalJoinStateManagerTypedBase, RightIncrementalNaturalJoinStateManager, RightIncrementalNaturalJoinStateManagerTypedBase

public interface IncrementalNaturalJoinStateManager
  • Field Details

    • EMPTY_RIGHT_STATE

      static final long EMPTY_RIGHT_STATE
      The right state of a hash slot that has never held a key.
      See Also:
    • TOMBSTONE_RIGHT_STATE

      static final long TOMBSTONE_RIGHT_STATE
      The right state of a hash slot whose key was deleted (only produced by the both-incremental state manager).
      See Also:
    • FIRST_DUPLICATE

      static final long FIRST_DUPLICATE
      Right states at or below this value encode a location in the right-side duplicate row sets: FIRST_DUPLICATE maps to location 0, FIRST_DUPLICATE - 1 to location 1, and so on. A right state above this value is a single right row key, RowSequence.NULL_ROW_KEY for a key with no right row, or the tombstone.
      See Also:
  • Method Details

    • isDuplicateRightState

      static boolean isDuplicateRightState(long rightState)
      Parameters:
      rightState - a right state as stored in a hash slot
      Returns:
      whether the state encodes a duplicate row set location, rather than a row key or one of the no-right-row markers (RowSequence.NULL_ROW_KEY, TOMBSTONE_RIGHT_STATE, EMPTY_RIGHT_STATE)
    • getRightRowKey

      long getRightRowKey(int slot)
    • getRightRowSet

      RowSet getRightRowSet(int slot)
    • getLeftRowSet

      RowSet getLeftRowSet(int slot)
    • keyString

      String keyString(int slot)
    • checkExactMatch

      void checkExactMatch(long leftKeyIndex, long rightSide)
    • getRightRowKeyFromDuplicates

      default long getRightRowKeyFromDuplicates(WritableRowSet duplicates, NaturalJoinType joinType)
      Given the join type, return the correct row key from the set of RHS duplicates.
    • duplicateCreationChangesState

      default boolean duplicateCreationChangesState(WritableRowSet duplicates, long existingRightRowKey, NaturalJoinType joinType)
      Whether turning a slot's single right row into a duplicate set changes what its left rows must observe. The join types that reject duplicates must record the slot so the error is raised while processing the modified slots; the others only when the newly selected right row differs from the one the left rows already hold.
      Parameters:
      duplicates - the duplicate set, after the new key has been added
      existingRightRowKey - the slot's right row key before the duplicate set was created
      joinType - the join type
      Returns:
      whether the slot must be recorded as changed in the modified slot tracker
    • addRightRowKeyToDuplicates

      default long addRightRowKeyToDuplicates(WritableRowSet duplicates, long keyToRemove, NaturalJoinType joinType)
      Add a key to the RHS duplicates, return the appropriate row key from this set *AFTER* the addition.
    • removeRightRowKeyFromDuplicates

      default long removeRightRowKeyFromDuplicates(WritableRowSet duplicates, long keyToRemove, NaturalJoinType joinType)
      Remove the key from the RHS duplicates, return the appropriate row key from this set *BEFORE* the removal.
    • shiftOneKey

      default void shiftOneKey(WritableRowSet duplicates, long shiftedKey, long shiftDelta)
      Shift a key in the RHS duplicate row set.