Module org.elasticsearch.server
Record Class ReservedStateMetadata
java.lang.Object
java.lang.Record
org.elasticsearch.cluster.metadata.ReservedStateMetadata
- All Implemented Interfaces:
Diffable<ReservedStateMetadata>
,SimpleDiffable<ReservedStateMetadata>
,Writeable
,ToXContent
,ToXContentFragment
public record ReservedStateMetadata(String namespace, Long version, Map<String,ReservedStateHandlerMetadata> handlers, ReservedStateErrorMetadata errorMetadata)
extends Record
implements SimpleDiffable<ReservedStateMetadata>, ToXContentFragment
Metadata class that contains information about reserved cluster state set
through file based settings or by modules/plugins.
These types of cluster settings/entities can be read through the REST API, but can only be modified through a versioned 'operator mode' update, e.g. file based settings or module/plugin upgrade.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.elasticsearch.cluster.SimpleDiffable
SimpleDiffable.CompleteDiff<T extends Diffable<T>>
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Fields inherited from interface org.elasticsearch.cluster.SimpleDiffable
EMPTY
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS
-
Constructor Summary
ConstructorsConstructorDescriptionReservedStateMetadata
(String namespace, Long version, Map<String, ReservedStateHandlerMetadata> handlers, ReservedStateErrorMetadata errorMetadata) ReservedStateMetadata contains information about reserved cluster settings. -
Method Summary
Modifier and TypeMethodDescriptionConvenience method for creating aReservedStateMetadata.Builder
forReservedStateMetadata
builder
(String namespace, ReservedStateMetadata metadata) Convenience method for creating aReservedStateMetadata.Builder
forReservedStateMetadata
Creates a set intersection between cluster state keys set by a givenReservedClusterStateHandler
and the input set.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of theerrorMetadata
record component.static ReservedStateMetadata
fromXContent
(XContentParser parser) ReadsReservedStateMetadata
fromXContentParser
handlers()
Returns the value of thehandlers
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of thenamespace
record component.static Diff<ReservedStateMetadata>
static ReservedStateMetadata
readFrom
(StreamInput in) Reads anReservedStateMetadata
from aStreamInput
final String
toString()
Returns a string representation of this record class.toXContent
(XContentBuilder builder, ToXContent.Params params) version()
Returns the value of theversion
record component.void
writeTo
(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.cluster.SimpleDiffable
diff
Methods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Constructor Details
-
ReservedStateMetadata
public ReservedStateMetadata(String namespace, Long version, Map<String, ReservedStateHandlerMetadata> handlers, ReservedStateErrorMetadata errorMetadata) ReservedStateMetadata contains information about reserved cluster settings.These settings cannot be updated by the end user and are set outside of the REST layer, e.g. through file based settings or by plugin/modules.
- Parameters:
namespace
- The namespace of the setting creator, e.g. file_settings, security plugin, etc.version
- The update version, must increase with each updatehandlers
- Per state update handler information on key set in by this update. These keys are validated at REST time.errorMetadata
- If the update failed for some reason, this is where we store the error information metadata.
-
-
Method Details
-
conflicts
Creates a set intersection between cluster state keys set by a givenReservedClusterStateHandler
and the input set.This method is to be used to check if a REST action handler is allowed to modify certain cluster state.
- Parameters:
handlerName
- the name of the reserved state handler we need to check for keysmodified
- a set of keys we want to see if we can modify.- Returns:
-
readFrom
Reads anReservedStateMetadata
from aStreamInput
- Parameters:
in
- theStreamInput
to read from- Returns:
ReservedStateMetadata
- Throws:
IOException
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
readDiffFrom
- Parameters:
in
- theStreamInput
to read the diff from- Returns:
- a
Diff
ofReservedStateMetadata
- Throws:
IOException
-
builder
Convenience method for creating aReservedStateMetadata.Builder
forReservedStateMetadata
- Parameters:
namespace
- the namespace under which we'll store theReservedStateMetadata
- Returns:
ReservedStateMetadata.Builder
-
builder
public static ReservedStateMetadata.Builder builder(String namespace, ReservedStateMetadata metadata) Convenience method for creating aReservedStateMetadata.Builder
forReservedStateMetadata
- Parameters:
namespace
- the namespace under which we'll store theReservedStateMetadata
metadata
- an existingReservedStateMetadata
- Returns:
ReservedStateMetadata.Builder
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContent
in interfaceToXContent
- Throws:
IOException
-
fromXContent
ReadsReservedStateMetadata
fromXContentParser
- Parameters:
parser
-XContentParser
- Returns:
ReservedStateMetadata
- Throws:
IOException
-
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)
. -
namespace
Returns the value of thenamespace
record component.- Returns:
- the value of the
namespace
record component
-
version
Returns the value of theversion
record component.- Returns:
- the value of the
version
record component
-
handlers
Returns the value of thehandlers
record component.- Returns:
- the value of the
handlers
record component
-
errorMetadata
Returns the value of theerrorMetadata
record component.- Returns:
- the value of the
errorMetadata
record component
-