Class InPlaceMutableHashTable.HashTableProber<PT>

  • Type Parameters:
    PT - The type of the records that we are probing with
    Enclosing class:
    InPlaceMutableHashTable<T>

    public final class InPlaceMutableHashTable.HashTableProber<PT>
    extends AbstractHashTableProber<PT,​T>
    A prober for accessing the table. In addition to getMatchFor and updateMatch, it also has insertAfterNoMatch. Warning: Don't modify the table between calling getMatchFor and the other methods!
    • Constructor Detail

      • HashTableProber

        public HashTableProber​(org.apache.flink.api.common.typeutils.TypeComparator<PT> probeTypeComparator,
                               org.apache.flink.api.common.typeutils.TypePairComparator<PT,​T> pairComparator)
    • Method Detail

      • getMatchFor

        public T getMatchFor​(PT record,
                             T targetForMatch)
        Searches the hash table for the record with the given key. (If there would be multiple matches, only one is returned.)
        Specified by:
        getMatchFor in class AbstractHashTableProber<PT,​T>
        Parameters:
        record - The record whose key we are searching for
        targetForMatch - If a match is found, it will be written here
        Returns:
        targetForMatch if a match is found, otherwise null.
      • updateMatch

        public void updateMatch​(T newRecord)
                         throws IOException
        This method can be called after getMatchFor returned a match. It will overwrite the record that was found by getMatchFor. Warning: The new record should have the same key as the old! WARNING; Don't do any modifications to the table between getMatchFor and updateMatch!
        Specified by:
        updateMatch in class AbstractHashTableProber<PT,​T>
        Parameters:
        newRecord - The record to override the old record with.
        Throws:
        IOException - (EOFException specifically, if memory ran out)
      • insertAfterNoMatch

        public void insertAfterNoMatch​(T record)
                                throws IOException
        This method can be called after getMatchFor returned null. It inserts the given record to the hash table. Important: The given record should have the same key as the record that was given to getMatchFor! WARNING; Don't do any modifications to the table between getMatchFor and insertAfterNoMatch!
        Throws:
        IOException - (EOFException specifically, if memory ran out)