Class LongHashPartition

  • All Implemented Interfaces:
    DataInput, DataInputView, SeekableDataInputView

    public class LongHashPartition
    extends AbstractPagedInputView
    implements SeekableDataInputView
    Partition for LongHybridHashTable.

    The layout of the buckets inside a memory segment is as follows:

    Hash mode: +----------------------------- Bucket area ---------------------------- | long key (8 bytes) | address (8 bytes) | | long key (8 bytes) | address (8 bytes) | | long key (8 bytes) | address (8 bytes) | | ... +----------------------------- Data area -------------------------- | size & address of next row with the same key (8bytes) | binary row | | size & address of next row with the same key (8bytes) | binary row | | size & address of next row with the same key (8bytes) | binary row | | ...

    Dense mode: +----------------------------- Bucket area ---------------------------- | address1 (8 bytes) | address2 (8 bytes) | address3 (8 bytes) | ... Directly addressed by the index of the corresponding array of key values.

    • Method Detail

      • get

        public LongHashPartition.MatchIterator get​(long key,
                                                   int hashCode)
        Returns an iterator for all the values for the given key, or null if no value found.
      • nextSegment

        protected MemorySegment nextSegment​(MemorySegment current)
                                     throws IOException
        Description copied from class: AbstractPagedInputView
        The method by which concrete subclasses realize page crossing. This method is invoked when the current page is exhausted and a new page is required to continue the reading. If no further page is available, this method must throw an EOFException.
        Specified by:
        nextSegment in class AbstractPagedInputView
        Parameters:
        current - The current page that was read to its limit. May be null, if this method is invoked for the first time.
        Returns:
        The next page from which the reading should continue. May not be null. If the input is exhausted, an EOFException must be thrown instead.
        Throws:
        EOFException - Thrown, if no further segment is available.
        IOException - Thrown, if the method cannot provide the next page due to an I/O related problem.
      • getLimitForSegment

        protected int getLimitForSegment​(MemorySegment segment)
        Description copied from class: AbstractPagedInputView
        Gets the limit for reading bytes from the given memory segment. This method must return the position of the byte after the last valid byte in the given memory segment. When the position returned by this method is reached, the view will attempt to switch to the next memory segment.
        Specified by:
        getLimitForSegment in class AbstractPagedInputView
        Parameters:
        segment - The segment to determine the limit for.
        Returns:
        The limit for the given memory segment.