public class IndexMetaData extends Object implements Diffable<IndexMetaData>, FromXContentBuilder<IndexMetaData>, ToXContent
Modifier and Type | Class and Description |
---|---|
static class |
IndexMetaData.Builder |
static interface |
IndexMetaData.Custom |
static class |
IndexMetaData.State |
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
EMPTY_PARAMS
Modifier and Type | Method and Description |
---|---|
static Settings |
addHumanReadableSettings(Settings settings)
Adds human readable version and creation date settings.
|
static IndexMetaData.Builder |
builder(IndexMetaData indexMetaData) |
static IndexMetaData.Builder |
builder(String index) |
<T extends IndexMetaData.Custom> |
custom(String type) |
Diff<IndexMetaData> |
diff(IndexMetaData previousState)
Returns serializable object representing differences between this and previousState
|
boolean |
equals(Object o) |
DiscoveryNodeFilters |
excludeFilters() |
IndexMetaData |
fromXContent(XContentParser parser,
ParseFieldMatcher parseFieldMatcher)
Parses an object with the type T from parser
|
ImmutableOpenMap<String,AliasMetaData> |
getAliases() |
long |
getCreationDate() |
Version |
getCreationVersion()
Return the
Version on which this index has been created. |
ImmutableOpenMap<String,IndexMetaData.Custom> |
getCustoms() |
String |
getIndex() |
String |
getIndexUUID() |
ImmutableOpenMap<String,MappingMetaData> |
getMappings() |
org.apache.lucene.util.Version |
getMinimumCompatibleVersion()
Return the
Version of the oldest lucene segment in the index |
int |
getNumberOfReplicas() |
int |
getNumberOfShards() |
HashFunction |
getRoutingHashFunction()
Return the
HashFunction that should be used for routing. |
boolean |
getRoutingUseType()
Return whether routing should use the _type in addition to the _id in
order to decide which shard a document should go to.
|
Settings |
getSettings() |
IndexMetaData.State |
getState() |
int |
getTotalNumberOfShards() |
Version |
getUpgradeVersion()
Return the
Version on which this index has been upgraded. |
long |
getVersion() |
int |
hashCode() |
DiscoveryNodeFilters |
includeFilters() |
static boolean |
isIndexUsingShadowReplicas(Settings settings)
Returns
true iff the given settings indicate that the index associated
with these settings uses shadow replicas. |
static boolean |
isOnSharedFilesystem(Settings settings)
Returns
true iff the given settings indicate that the index
associated with these settings allocates it's shards on a shared
filesystem. |
boolean |
isSameUUID(String otherUUID)
Test whether the current index UUID is the same as the given one.
|
static <T extends IndexMetaData.Custom> |
lookupPrototype(String type) |
static <T extends IndexMetaData.Custom> |
lookupPrototypeSafe(String type) |
MappingMetaData |
mapping(String mappingType) |
MappingMetaData |
mappingOrDefault(String mappingType)
Sometimes, the default mapping exists and an actual mapping is not created yet (introduced),
in this case, we want to return the default mapping in case it has some default mapping definitions.
|
Diff<IndexMetaData> |
readDiffFrom(StreamInput in)
Reads the
Diff from StreamInput |
IndexMetaData |
readFrom(StreamInput in)
Reads a copy of an object with the same type form the stream input
The caller object remains unchanged.
|
static void |
registerPrototype(String type,
IndexMetaData.Custom proto)
Register a custom index meta data factory.
|
DiscoveryNodeFilters |
requireFilters() |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out)
Writes the current object into the output stream out
|
public static final IndexMetaData PROTO
public static Map<String,IndexMetaData.Custom> customPrototypes
public static final ClusterBlock INDEX_READ_ONLY_BLOCK
public static final ClusterBlock INDEX_READ_BLOCK
public static final ClusterBlock INDEX_WRITE_BLOCK
public static final ClusterBlock INDEX_METADATA_BLOCK
public static final String INDEX_SETTING_PREFIX
public static final String SETTING_NUMBER_OF_SHARDS
public static final String SETTING_NUMBER_OF_REPLICAS
public static final String SETTING_SHADOW_REPLICAS
public static final String SETTING_SHARED_FILESYSTEM
public static final String SETTING_AUTO_EXPAND_REPLICAS
public static final String SETTING_READ_ONLY
public static final String SETTING_BLOCKS_READ
public static final String SETTING_BLOCKS_WRITE
public static final String SETTING_BLOCKS_METADATA
public static final String SETTING_VERSION_CREATED
public static final String SETTING_VERSION_CREATED_STRING
public static final String SETTING_VERSION_UPGRADED
public static final String SETTING_VERSION_UPGRADED_STRING
public static final String SETTING_VERSION_MINIMUM_COMPATIBLE
public static final String SETTING_CREATION_DATE
public static final String SETTING_PRIORITY
public static final String SETTING_CREATION_DATE_STRING
public static final String SETTING_INDEX_UUID
public static final String SETTING_LEGACY_ROUTING_HASH_FUNCTION
public static final String SETTING_LEGACY_ROUTING_USE_TYPE
public static final String SETTING_DATA_PATH
public static final String SETTING_SHARED_FS_ALLOW_RECOVERY_ON_ANY_NODE
public static final String INDEX_UUID_NA_VALUE
public static void registerPrototype(String type, IndexMetaData.Custom proto)
@Nullable public static <T extends IndexMetaData.Custom> T lookupPrototype(String type)
public static <T extends IndexMetaData.Custom> T lookupPrototypeSafe(String type)
public String getIndex()
public String getIndexUUID()
public boolean isSameUUID(String otherUUID)
public long getVersion()
public Version getCreationVersion()
Version
on which this index has been created. This
information is typically useful for backward compatibility.public Version getUpgradeVersion()
Version
on which this index has been upgraded. This
information is typically useful for backward compatibility.public org.apache.lucene.util.Version getMinimumCompatibleVersion()
Version
of the oldest lucene segment in the indexpublic HashFunction getRoutingHashFunction()
HashFunction
that should be used for routing.public boolean getRoutingUseType()
public long getCreationDate()
public IndexMetaData.State getState()
public int getNumberOfShards()
public int getNumberOfReplicas()
public int getTotalNumberOfShards()
public Settings getSettings()
public ImmutableOpenMap<String,AliasMetaData> getAliases()
public ImmutableOpenMap<String,MappingMetaData> getMappings()
@Nullable public MappingMetaData mapping(String mappingType)
@Nullable public MappingMetaData mappingOrDefault(String mappingType)
Note, once the mapping type is introduced, the default mapping is applied on the actual typed MappingMetaData, setting its routing, timestamp, and so on if needed.
public ImmutableOpenMap<String,IndexMetaData.Custom> getCustoms()
public <T extends IndexMetaData.Custom> T custom(String type)
@Nullable public DiscoveryNodeFilters requireFilters()
@Nullable public DiscoveryNodeFilters includeFilters()
@Nullable public DiscoveryNodeFilters excludeFilters()
public Diff<IndexMetaData> diff(IndexMetaData previousState)
Diffable
diff
in interface Diffable<IndexMetaData>
public Diff<IndexMetaData> readDiffFrom(StreamInput in) throws IOException
Diffable
Diff
from StreamInputreadDiffFrom
in interface Diffable<IndexMetaData>
IOException
public IndexMetaData fromXContent(XContentParser parser, ParseFieldMatcher parseFieldMatcher) throws IOException
FromXContentBuilder
fromXContent
in interface FromXContentBuilder<IndexMetaData>
IOException
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
toXContent
in interface ToXContent
IOException
public IndexMetaData readFrom(StreamInput in) throws IOException
StreamableReader
readFrom
in interface StreamableReader<IndexMetaData>
IOException
public void writeTo(StreamOutput out) throws IOException
Writeable
writeTo
in interface Writeable<IndexMetaData>
IOException
public static IndexMetaData.Builder builder(String index)
public static IndexMetaData.Builder builder(IndexMetaData indexMetaData)
public static boolean isOnSharedFilesystem(Settings settings)
true
iff the given settings indicate that the index
associated with these settings allocates it's shards on a shared
filesystem. Otherwise false
. The default setting for this
is the returned value from
isIndexUsingShadowReplicas(org.elasticsearch.common.settings.Settings)
.public static boolean isIndexUsingShadowReplicas(Settings settings)
true
iff the given settings indicate that the index associated
with these settings uses shadow replicas. Otherwise false
. The default
setting for this is false
.Copyright © 2009–2016. All rights reserved.