Class Metadata.Builder
java.lang.Object
org.elasticsearch.cluster.metadata.Metadata.Builder
- Enclosing class:
- Metadata
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
build
(boolean builtIndicesLookupEagerly) clusterUUID
(String clusterUUID) clusterUUIDCommitted
(boolean clusterUUIDCommitted) componentTemplates
(Map<String, ComponentTemplate> componentTemplates) coordinationMetadata
(CoordinationMetadata coordinationMetadata) customs
(ImmutableOpenMap<String, Metadata.Custom> customs) dataStream
(String dataStreamName) dataStreams
(Map<String, DataStream> dataStreams, Map<String, DataStreamAlias> dataStreamAliases) static Metadata
fromXContent
(XContentParser parser) hashesOfConsistentSettings
(Map<String, String> hashesOfConsistentSettings) hashesOfConsistentSettings
(DiffableStringMap hashesOfConsistentSettings) indexGraveyard
(IndexGraveyard indexGraveyard) indexTemplates
(Map<String, ComposableIndexTemplate> indexTemplates) indices
(ImmutableOpenMap<String, IndexMetadata> indices) persistentSettings
(Settings settings) boolean
put
(String name, ComponentTemplate componentTemplate) put
(String name, ComposableIndexTemplate indexTemplate) put
(DataStream dataStream) put
(IndexMetadata.Builder indexMetadataBuilder) put
(IndexMetadata indexMetadata, boolean incrementVersion) put
(IndexTemplateMetadata template) put
(IndexTemplateMetadata.Builder template) putCustom
(String type, Metadata.Custom custom) removeCustom
(String type) removeDataStream
(String name) boolean
removeDataStreamAlias
(String aliasName, String dataStreamName, boolean mustExist) removeIndexTemplate
(String name) removeTemplate
(String templateName) templates
(ImmutableOpenMap<String, IndexTemplateMetadata> templates) static void
toXContent
(Metadata metadata, XContentBuilder builder, ToXContent.Params params) transientSettings
(Settings settings) updateNumberOfReplicas
(int numberOfReplicas, String[] indices) Update the number of replicas for the specified indices.updateSettings
(Settings settings, String... indices) version
(long version)
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
put
-
put
-
get
-
getSafe
-
remove
-
removeAllIndices
-
indices
-
put
-
put
-
removeTemplate
-
templates
-
put
-
removeComponentTemplate
-
componentTemplates
-
indexTemplates
-
put
-
removeIndexTemplate
-
dataStream
-
dataStreams
public Metadata.Builder dataStreams(Map<String, DataStream> dataStreams, Map<String, DataStreamAlias> dataStreamAliases) -
put
-
dataStreamMetadata
-
put
-
removeDataStream
-
removeDataStreamAlias
-
getCustom
-
putCustom
-
removeCustom
-
customs
-
indexGraveyard
-
indexGraveyard
-
updateSettings
-
updateNumberOfReplicas
Update the number of replicas for the specified indices.- Parameters:
numberOfReplicas
- the number of replicasindices
- the indices to update the number of replicas for- Returns:
- the builder
-
coordinationMetadata
-
transientSettings
-
transientSettings
-
persistentSettings
-
persistentSettings
-
hashesOfConsistentSettings
-
hashesOfConsistentSettings
-
hashesOfConsistentSettings
-
version
-
clusterUUID
-
clusterUUIDCommitted
-
generateClusterUuidIfNeeded
-
build
- Returns:
- a new
Metadata
instance
-
build
- Parameters:
builtIndicesLookupEagerly
- Controls whether indices lookup should be build as part of the execution of this method or after when needed. Almost all of the time indices lookup should be built eagerly, however in certain cases whenMetdata
instances are build that are not published and many indices have been defined then it makes sense to skip building indices lookup.- Returns:
- a new
Metadata
instance
-
toXContent
public static void toXContent(Metadata metadata, XContentBuilder builder, ToXContent.Params params) throws IOException - Throws:
IOException
-
fromXContent
- Throws:
IOException
-