Interface HashedTupleFile

  • All Superinterfaces:
    TupleFile

    public interface HashedTupleFile
    extends TupleFile
    This interface extends the TupleFile interface, adding operations that can be provided on files of tuples that are hashed on a specific key. The key used to hash tuples is returned by the getKeySpec() method.
    • Method Detail

      • getKeySpec

        java.util.List<Expression> getKeySpec()
        Returns the column(s) that comprise the hash key in this tuple file.
        Returns:
        the column(s) that comprise the hash key in this tuple file.
      • findFirstTupleEquals

        Tuple findFirstTupleEquals​(Tuple hashKey)
        Returns the first tuple in the file that has the same hash-key values, or null if there are no tuples with this hash-key value in the tuple file.
        Parameters:
        hashKey - the tuple to search for
        Returns:
        The first tuple in the file with the same hash-key values, or null if the file contains no files with the specified search key value. This tuple will actually be backed by the tuple file, so typically it will be a subclass of PageTuple.
      • findNextTupleEquals

        Tuple findNextTupleEquals​(Tuple prevTuple)
        Returns the next entry in the index that has the same hash-key value, or null if there are no more entries with this hash-key value in the tuple file.
        Parameters:
        prevTuple - The tuple from which to resume the search for the next tuple with the same hash-key values. This should be a tuple returned by a previous call to findFirstTupleEquals(edu.caltech.nanodb.relations.Tuple) or findNextTupleEquals(edu.caltech.nanodb.relations.Tuple); using any other tuple would be an error.
        Returns:
        The next tuple in the file with the same hash-key values, or null if there are no more entries with this hash-key value in the file.