Record Class FileSetFingerprint

java.lang.Object
java.lang.Record
org.elasticsearch.xpack.esql.datasources.FileSetFingerprint

public record FileSetFingerprint(long high, long low) extends Record
The 128-bit fingerprint of a resolved file SET, carried as two 64-bit Murmur3 lanes.

Computed by FileSetFingerprints#compute as a commutative fold over every file's (path, mtime, size), with the file count mixed into the final avalanche: the same set listed in any order yields the same fingerprint, and any file added, removed, or modified yields a different one. That makes fingerprint-derived cache keys correct-or-miss by construction — no invalidation protocol.

128 bits, not 64, because a collision serves one set's row count for a different set — a wrong answer, not a slow path. A 64-bit hash birthday-collides around 2^32 distinct sets (reachable on a long-lived coordinator); 128 bits (~2^64) makes it negligible. Non-cryptographic (Murmur3): guards accidental staleness, not an adversary crafting a collision.

Lives in datasources (not the glob impl package) because it is the return type of the spi.FileList SPI method, alongside its sibling value type PartitionMetadata.

  • Constructor Summary

    Constructors
    Constructor
    Description
    FileSetFingerprint(long high, long low)
    Creates an instance of a FileSetFingerprint record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    long
    Returns the value of the high record component.
    long
    low()
    Returns the value of the low record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FileSetFingerprint

      public FileSetFingerprint(long high, long low)
      Creates an instance of a FileSetFingerprint record class.
      Parameters:
      high - the value for the high record component
      low - the value for the low record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • high

      public long high()
      Returns the value of the high record component.
      Returns:
      the value of the high record component
    • low

      public long low()
      Returns the value of the low record component.
      Returns:
      the value of the low record component