Record Class SchemaCacheKey

java.lang.Object
java.lang.Record
org.elasticsearch.xpack.esql.datasources.cache.SchemaCacheKey

public record SchemaCacheKey(String canonicalPath, long lastModifiedEpochMillis, String formatType, String formatConfig, String endpoint, String region) extends Record
Cache key for schema inference results. Includes mtime-in-key for invalidation. Endpoint and region are included because the same canonical path on different endpoints resolves to different objects.
  • Constructor Details

    • SchemaCacheKey

      public SchemaCacheKey(String canonicalPath, long lastModifiedEpochMillis, String formatType, String formatConfig, String endpoint, String region)
      Creates an instance of a SchemaCacheKey record class.
      Parameters:
      canonicalPath - the value for the canonicalPath record component
      lastModifiedEpochMillis - the value for the lastModifiedEpochMillis record component
      formatType - the value for the formatType record component
      formatConfig - the value for the formatConfig record component
      endpoint - the value for the endpoint record component
      region - the value for the region record component
  • Method Details

    • build

      public static SchemaCacheKey build(String canonicalPath, long mtime, String formatType, Map<String,Object> config)
    • 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.
    • canonicalPath

      public String canonicalPath()
      Returns the value of the canonicalPath record component.
      Returns:
      the value of the canonicalPath record component
    • lastModifiedEpochMillis

      public long lastModifiedEpochMillis()
      Returns the value of the lastModifiedEpochMillis record component.
      Returns:
      the value of the lastModifiedEpochMillis record component
    • formatType

      public String formatType()
      Returns the value of the formatType record component.
      Returns:
      the value of the formatType record component
    • formatConfig

      public String formatConfig()
      Returns the value of the formatConfig record component.
      Returns:
      the value of the formatConfig record component
    • endpoint

      public String endpoint()
      Returns the value of the endpoint record component.
      Returns:
      the value of the endpoint record component
    • region

      public String region()
      Returns the value of the region record component.
      Returns:
      the value of the region record component