Record Class ListingHint

java.lang.Object
java.lang.Record
org.elasticsearch.xpack.esql.datasources.spi.ListingHint
Record Components:
length - the object's length in bytes
lastModifiedMillis - the object's last-modified time, in epoch milliseconds

public record ListingHint(long length, long lastModifiedMillis) extends Record
Metadata about a file already known from a directory listing, passed to ExternalSourceFactory.resolveMetadataAsync(java.lang.String, org.elasticsearch.xpack.esql.datasources.spi.ListingHint, java.util.Map<java.lang.String, java.lang.Object>, java.util.concurrent.Executor, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.esql.datasources.spi.SourceMetadata>) so the factory can build the storage object without a synchronous existence/HEAD probe before the async metadata read. A null hint means nothing is known (e.g. a single, explicitly-referenced path) and the factory is responsible for verifying existence itself.

New listing-derived fields (etag/version-id, checksum, storage class, ...) should be added here rather than as extra parameters, so the async-resolution signature and its overrides stay stable.

  • Constructor Summary

    Constructors
    Constructor
    Description
    ListingHint(long length, long lastModifiedMillis)
    Creates an instance of a ListingHint 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 lastModifiedMillis record component.
    long
    Returns the value of the length 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

    • ListingHint

      public ListingHint(long length, long lastModifiedMillis)
      Creates an instance of a ListingHint record class.
      Parameters:
      length - the value for the length record component
      lastModifiedMillis - the value for the lastModifiedMillis 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.
    • length

      public long length()
      Returns the value of the length record component.
      Returns:
      the value of the length record component
    • lastModifiedMillis

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