Record Class SchemaCacheEntry
java.lang.Object
java.lang.Record
org.elasticsearch.xpack.esql.datasources.cache.SchemaCacheEntry
public record SchemaCacheEntry(String[] columnNames, DataType[] columnTypes, Nullability[] columnNullabilities, boolean[] columnSynthetics, String sourceType, String location, Map<String,Object> safeMetadata, long cachedAtMillis)
extends Record
Cache entry for schema inference results. Stores raw schema data (names, types,
nullabilities) instead of Attribute objects to avoid NameId sharing across queries.
Each call to
toAttributes() reconstructs fresh ReferenceAttribute instances
with fresh NameIds, ensuring safe concurrent use.-
Constructor Summary
ConstructorsConstructorDescriptionSchemaCacheEntry(String[] columnNames, DataType[] columnTypes, Nullability[] columnNullabilities, boolean[] columnSynthetics, String sourceType, String location, Map<String, Object> safeMetadata, long cachedAtMillis) Creates an instance of aSchemaCacheEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thecachedAtMillisrecord component.String[]Returns the value of thecolumnNamesrecord component.Returns the value of thecolumnNullabilitiesrecord component.boolean[]Returns the value of thecolumnSyntheticsrecord component.DataType[]Returns the value of thecolumnTypesrecord component.final booleanIndicates whether some other object is "equal to" this one.longstatic SchemaCacheEntryfinal inthashCode()Returns a hash code value for this object.location()Returns the value of thelocationrecord component.Returns the value of thesafeMetadatarecord component.Returns the value of thesourceTyperecord component.Reconstructs fresh Attributes with fresh NameIds -- safe for concurrent queriesfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SchemaCacheEntry
public SchemaCacheEntry(String[] columnNames, DataType[] columnTypes, Nullability[] columnNullabilities, boolean[] columnSynthetics, String sourceType, String location, Map<String, Object> safeMetadata, long cachedAtMillis) Creates an instance of aSchemaCacheEntryrecord class.- Parameters:
columnNames- the value for thecolumnNamesrecord componentcolumnTypes- the value for thecolumnTypesrecord componentcolumnNullabilities- the value for thecolumnNullabilitiesrecord componentcolumnSynthetics- the value for thecolumnSyntheticsrecord componentsourceType- the value for thesourceTyperecord componentlocation- the value for thelocationrecord componentsafeMetadata- the value for thesafeMetadatarecord componentcachedAtMillis- the value for thecachedAtMillisrecord component
-
-
Method Details
-
from
-
toAttributes
Reconstructs fresh Attributes with fresh NameIds -- safe for concurrent queries -
estimatedBytes
public long estimatedBytes() -
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 '=='. -
columnNames
Returns the value of thecolumnNamesrecord component.- Returns:
- the value of the
columnNamesrecord component
-
columnTypes
Returns the value of thecolumnTypesrecord component.- Returns:
- the value of the
columnTypesrecord component
-
columnNullabilities
Returns the value of thecolumnNullabilitiesrecord component.- Returns:
- the value of the
columnNullabilitiesrecord component
-
columnSynthetics
public boolean[] columnSynthetics()Returns the value of thecolumnSyntheticsrecord component.- Returns:
- the value of the
columnSyntheticsrecord component
-
sourceType
Returns the value of thesourceTyperecord component.- Returns:
- the value of the
sourceTyperecord component
-
location
Returns the value of thelocationrecord component.- Returns:
- the value of the
locationrecord component
-
safeMetadata
Returns the value of thesafeMetadatarecord component.- Returns:
- the value of the
safeMetadatarecord component
-
cachedAtMillis
public long cachedAtMillis()Returns the value of thecachedAtMillisrecord component.- Returns:
- the value of the
cachedAtMillisrecord component
-