Record Class SchemaCacheKey
fileSetFingerprint carries the 128-bit fingerprint of the resolved file set for a
dataset-level aggregate key (see forDatasetAggregate(java.lang.String, org.elasticsearch.xpack.esql.datasources.FileSetFingerprint, java.lang.String, java.util.Map<java.lang.String, java.lang.Object>)); it is null for every
per-file key. A named component rather than smuggling the fingerprint into the mtime/path slots —
record equality/hashCode pick it up automatically.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSchemaCacheKey(String canonicalPath, long lastModifiedEpochMillis, String formatType, String formatConfig, String endpoint, String region, FileSetFingerprint fileSetFingerprint) Creates an instance of aSchemaCacheKeyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SchemaCacheKeystatic StringbuildFormatConfig(Map<String, Object> config) Canonical, node-stable identity of the row-interpretation-affecting config: the format-affecting params (credentials and non-format keys excluded), sorted and renderedkey=value,....Returns the value of thecanonicalPathrecord component.endpoint()Returns the value of theendpointrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefileSetFingerprintrecord component.static SchemaCacheKeyforDatasetAggregate(String pattern, FileSetFingerprint fingerprint, String sourceType, Map<String, Object> config) Key for a dataset-level aggregate entry: the memoized multi-file stats fold for one resolved file SET under one format config.Returns the value of theformatConfigrecord component.Returns the value of theformatTyperecord component.final inthashCode()Returns a hash code value for this object.booleanTrue when this key addresses a dataset-level aggregate entry (minted byforDatasetAggregate(java.lang.String, org.elasticsearch.xpack.esql.datasources.FileSetFingerprint, java.lang.String, java.util.Map<java.lang.String, java.lang.Object>)) rather than a per-file schema entry.longReturns the value of thelastModifiedEpochMillisrecord component.region()Returns the value of theregionrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
STRICT_DECLARED_SCHEMA_MARKER
ReservedformatTypesuffix namespace: extension detection (detectFormatType) derivesformatTypefrom a file name's last dot, so for any sane object name a'#'-suffixed formatType is minted only by an explicit factory. (A pathological object name literally containing'#dataset-agg'would collide on the suffix, but a per-file key carries a nullfileSetFingerprintso it can never equal a dataset key - the only cost is that one file losing its warm enrichment, a miss, never a wrong answer.) Two members exist:STRICT_DECLARED_SCHEMA_MARKER(per-file entries on the strict-declared warm rail, which the reconcile's contribution matching MUST still reach) andDATASET_AGGREGATE_MARKER(dataset-level aggregate entries, which contribution matching must NEVER reach - enforced inExternalSourceCacheService#matchesContribution). Co-located here so their distinctness is visible at the declaration site.- See Also:
-
DATASET_AGGREGATE_MARKER
- See Also:
-
-
Constructor Details
-
SchemaCacheKey
public SchemaCacheKey(String canonicalPath, long lastModifiedEpochMillis, String formatType, String formatConfig, String endpoint, String region, @Nullable FileSetFingerprint fileSetFingerprint) Creates an instance of aSchemaCacheKeyrecord class.- Parameters:
canonicalPath- the value for thecanonicalPathrecord componentlastModifiedEpochMillis- the value for thelastModifiedEpochMillisrecord componentformatType- the value for theformatTyperecord componentformatConfig- the value for theformatConfigrecord componentendpoint- the value for theendpointrecord componentregion- the value for theregionrecord componentfileSetFingerprint- the value for thefileSetFingerprintrecord component
-
-
Method Details
-
build
-
forDatasetAggregate
public static SchemaCacheKey forDatasetAggregate(String pattern, FileSetFingerprint fingerprint, String sourceType, Map<String, Object> config) Key for a dataset-level aggregate entry: the memoized multi-file stats fold for one resolved file SET under one format config. Identity is the listing's 128-bit file-set fingerprint (a commutative fold of every file's path + mtime + size, plus the file count - seeFileList#fileSetFingerprint), which makes the key correct-or-miss by construction: any file added, removed, or modified derives a different key, and the stale entry simply ages out via LRU/TTL - no invalidation protocol. The fingerprint rides the dedicatedfileSetFingerprintrecord component;canonicalPathis the glob pattern (diagnostics-friendly) and the marker-suffixedformatTypekeeps these entries out of the per-file contribution-matching paths.Known residual, inherited from the per-file rail: under a lenient error policy (
skip_row/null_field) a harvested row count can be declaration-dependent (see thewarmsRowCountSafelydiscussion on the strict single-file rail). The dataset aggregate memoizes exactly what the per-file rail serves, so it neither narrows nor widens that residual - both must be closed together by the declared-schema fingerprint follow-up. -
isDatasetAggregate
public boolean isDatasetAggregate()True when this key addresses a dataset-level aggregate entry (minted byforDatasetAggregate(java.lang.String, org.elasticsearch.xpack.esql.datasources.FileSetFingerprint, java.lang.String, java.util.Map<java.lang.String, java.lang.Object>)) rather than a per-file schema entry. Centralizes theDATASET_AGGREGATE_MARKERcheck so the taxonomy lives with the key instead of being re-derived at each call site. -
buildFormatConfig
Canonical, node-stable identity of the row-interpretation-affecting config: the format-affecting params (credentials and non-format keys excluded), sorted and renderedkey=value,.... Deterministic across JVMs and independent of column projection, so a coordinator and a data node derive the same string for the same logical query config — the basis for the cross-node stats cache fingerprint. -
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
canonicalPath
Returns the value of thecanonicalPathrecord component.- Returns:
- the value of the
canonicalPathrecord component
-
lastModifiedEpochMillis
public long lastModifiedEpochMillis()Returns the value of thelastModifiedEpochMillisrecord component.- Returns:
- the value of the
lastModifiedEpochMillisrecord component
-
formatType
Returns the value of theformatTyperecord component.- Returns:
- the value of the
formatTyperecord component
-
formatConfig
Returns the value of theformatConfigrecord component.- Returns:
- the value of the
formatConfigrecord component
-
endpoint
Returns the value of theendpointrecord component.- Returns:
- the value of the
endpointrecord component
-
region
Returns the value of theregionrecord component.- Returns:
- the value of the
regionrecord component
-
fileSetFingerprint
Returns the value of thefileSetFingerprintrecord component.- Returns:
- the value of the
fileSetFingerprintrecord component
-