Class IndexMetaData.Builder
java.lang.Object
org.elasticsearch.cluster.metadata.IndexMetaData.Builder
- Enclosing class:
- IndexMetaData
public static class IndexMetaData.Builder
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description Builder(java.lang.String index)Builder(IndexMetaData indexMetaData) -
Method Summary
Modifier and Type Method Description longaliasesVersion()IndexMetaData.BuilderaliasesVersion(long aliasesVersion)IndexMetaDatabuild()IndexMetaData.BuildercreationDate(long creationDate)static IndexMetaDatafromXContent(XContentParser parser)java.util.Set<java.lang.String>getInSyncAllocationIds(int shardId)intgetRoutingNumShards()Returns number of shards that should be used for routing.IndexMetaData.Builderindex(java.lang.String index)MappingMetaDatamapping(java.lang.String type)longmappingVersion()IndexMetaData.BuildermappingVersion(long mappingVersion)IndexMetaData.BuildernumberOfReplicas(int numberOfReplicas)intnumberOfShards()Returns the number of shards.IndexMetaData.BuildernumberOfShards(int numberOfShards)longprimaryTerm(int shardId)returns the primary term for the given shard.IndexMetaData.BuilderprimaryTerm(int shardId, long primaryTerm)sets the primary term for the given shard.IndexMetaData.BuilderputAlias(AliasMetaData aliasMetaData)IndexMetaData.BuilderputAlias(AliasMetaData.Builder aliasMetaData)IndexMetaData.BuilderputCustom(java.lang.String type, java.util.Map<java.lang.String,java.lang.String> customIndexMetaData)IndexMetaData.BuilderputInSyncAllocationIds(int shardId, java.util.Set<java.lang.String> allocationIds)IndexMetaData.BuilderputMapping(java.lang.String type, java.lang.String source)IndexMetaData.BuilderputMapping(MappingMetaData mappingMd)IndexMetaData.BuilderputRolloverInfo(RolloverInfo rolloverInfo)IndexMetaData.BuilderremoveAlias(java.lang.String alias)IndexMetaData.BuilderremoveAllAliases()java.util.Map<java.lang.String,java.lang.String>removeCustom(java.lang.String type)IndexMetaData.BuilderroutingPartitionSize(int routingPartitionSize)IndexMetaData.BuildersetRoutingNumShards(int routingNumShards)Sets the number of shards that should be used for routing.IndexMetaData.Buildersettings(Settings settings)IndexMetaData.Buildersettings(Settings.Builder settings)longsettingsVersion()IndexMetaData.BuildersettingsVersion(long settingsVersion)IndexMetaData.Builderstate(IndexMetaData.State state)static voidtoXContent(IndexMetaData indexMetaData, XContentBuilder builder, ToXContent.Params params)longversion()IndexMetaData.Builderversion(long version)
-
Constructor Details
-
Method Details
-
index
-
numberOfShards
-
setRoutingNumShards
Sets the number of shards that should be used for routing. This should only be used if the number of shards in an index has changed ie if the index is shrunk. -
getRoutingNumShards
public int getRoutingNumShards()Returns number of shards that should be used for routing. By default this method will return the number of shards for this index.- See Also:
setRoutingNumShards(int),numberOfShards()
-
numberOfShards
public int numberOfShards()Returns the number of shards.- Returns:
- the provided value or -1 if it has not been set.
-
numberOfReplicas
-
routingPartitionSize
-
creationDate
-
settings
-
settings
-
mapping
-
putMapping
public IndexMetaData.Builder putMapping(java.lang.String type, java.lang.String source) throws java.io.IOException- Throws:
java.io.IOException
-
putMapping
-
state
-
putAlias
-
putAlias
-
removeAlias
-
removeAllAliases
-
putCustom
public IndexMetaData.Builder putCustom(java.lang.String type, java.util.Map<java.lang.String,java.lang.String> customIndexMetaData) -
removeCustom
public java.util.Map<java.lang.String,java.lang.String> removeCustom(java.lang.String type) -
getInSyncAllocationIds
public java.util.Set<java.lang.String> getInSyncAllocationIds(int shardId) -
putInSyncAllocationIds
public IndexMetaData.Builder putInSyncAllocationIds(int shardId, java.util.Set<java.lang.String> allocationIds) -
putRolloverInfo
-
version
public long version() -
version
-
mappingVersion
public long mappingVersion() -
mappingVersion
-
settingsVersion
public long settingsVersion() -
settingsVersion
-
aliasesVersion
public long aliasesVersion() -
aliasesVersion
-
primaryTerm
public long primaryTerm(int shardId)returns the primary term for the given shard. SeeIndexMetaData.primaryTerm(int)for more information. -
primaryTerm
sets the primary term for the given shard. SeeIndexMetaData.primaryTerm(int)for more information. -
build
-
toXContent
public static void toXContent(IndexMetaData indexMetaData, XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Throws:
java.io.IOException
-
fromXContent
- Throws:
java.io.IOException
-