Record Class SplitDiscoveryResult

java.lang.Object
java.lang.Record
org.elasticsearch.xpack.esql.datasources.spi.SplitDiscoveryResult

public record SplitDiscoveryResult(List<ExternalSplit> splits, int filesScanned) extends Record
Result of SplitProvider.discoverSplits(org.elasticsearch.xpack.esql.datasources.spi.SplitDiscoveryContext): the discovered splits plus the post-prune "scanned" accounting reported in the query profile.

filesScanned is the number of distinct files that survived coordinator-side pruning and contributed at least one split. It is provider-specific: file-based sources report the real count, while sources without a file concept (e.g. Arrow Flight) report 0. The other scanned metrics surfaced in the profile — total split count and estimated bytes (sum of ExternalSplit.estimatedSizeInBytes(), excluding splits that report an unknown size) — are derived by SplitDiscoveryPhase from the splits() list, so they are not carried here.

  • Field Details

  • Constructor Details

    • SplitDiscoveryResult

      public SplitDiscoveryResult(List<ExternalSplit> splits, int filesScanned)
      Creates an instance of a SplitDiscoveryResult record class.
      Parameters:
      splits - the value for the splits record component
      filesScanned - the value for the filesScanned record component
  • Method Details

    • of

      public static SplitDiscoveryResult of(List<ExternalSplit> splits)
      Convenience for providers that have no file-level accounting: carries the splits with a filesScanned of 0.
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • splits

      public List<ExternalSplit> splits()
      Returns the value of the splits record component.
      Returns:
      the value of the splits record component
    • filesScanned

      public int filesScanned()
      Returns the value of the filesScanned record component.
      Returns:
      the value of the filesScanned record component