Module org.elasticsearch.server
Record Class EndpointMetadata.Internal
java.lang.Object
java.lang.Record
org.elasticsearch.inference.metadata.EndpointMetadata.Internal
- Record Components:
fingerprint- an upstream fingerprint representing endpoint version. The upstream service controls this to indicate that known fields have changed (new properties for a model, status, etc).version- a schema version number for the metadata. This version is incremented when the structure of the metadata changes (e.g., new fields are added). This allows Elasticsearch to determine when it needs to update the metadata even if the upstream fingerprint is not changed. This is useful when the fingerprint has already changed but older Elasticsearch versions don't have the logic to handle a new field returned by the upstream service. This value allows Elasticsearch to determine which endpoints need to have their schema updated in a new version.
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentObject
- Enclosing class:
EndpointMetadata
public static record EndpointMetadata.Internal(String fingerprint, Long version)
extends Record
implements ToXContentObject, Writeable
Internal metadata used by Elasticsearch. This information is not exposed to clients of the Inference API. It helps the Inference
API know when it needs to update the preconfigured endpoints.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EndpointMetadata.Internalstatic final Stringstatic final StringFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefingerprintrecord component.final inthashCode()Returns a hash code value for this object.booleanisEmpty()static EndpointMetadata.Internalparse(XContentParser parser) final StringtoString()Returns a string representation of this record class.toXContent(XContentBuilder builder, ToXContent.Params params) version()Returns the value of theversionrecord component.voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
EMPTY_INSTANCE
-
FINGERPRINT_FIELD_NAME
- See Also:
-
VERSION_FIELD_NAME
- See Also:
-
-
Constructor Details
-
Internal
- Throws:
IOException
-
Internal
Creates an instance of aInternalrecord class.- Parameters:
fingerprint- the value for thefingerprintrecord componentversion- the value for theversionrecord component
-
-
Method Details
-
parse
- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
isEmpty
public boolean isEmpty() -
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. All components in this record class are compared withObjects::equals(Object,Object). -
fingerprint
Returns the value of thefingerprintrecord component.- Returns:
- the value of the
fingerprintrecord component
-
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-