public class MetaData extends Object implements Iterable<IndexMetaData>
Modifier and Type | Class and Description |
---|---|
static class |
MetaData.Builder |
static interface |
MetaData.Custom |
static class |
MetaData.XContentContext |
Modifier and Type | Field and Description |
---|---|
static String |
ALL |
static EnumSet<MetaData.XContentContext> |
API_AND_GATEWAY |
static EnumSet<MetaData.XContentContext> |
API_AND_SNAPSHOT |
static EnumSet<MetaData.XContentContext> |
API_ONLY |
static ClusterBlock |
CLUSTER_READ_ONLY_BLOCK |
static String |
CONTEXT_MODE_GATEWAY |
static String |
CONTEXT_MODE_PARAM |
static String |
CONTEXT_MODE_SNAPSHOT |
static Map<String,MetaData.Custom.Factory> |
customFactories |
static MetaData |
EMPTY_META_DATA |
static String |
SETTING_READ_ONLY |
Modifier and Type | Method and Description |
---|---|
ImmutableOpenMap<String,ImmutableOpenMap<String,AliasMetaData>> |
aliases() |
static MetaData.Builder |
builder() |
static MetaData.Builder |
builder(MetaData metaData) |
String[] |
concreteAllClosedIndices() |
String[] |
concreteAllIndices()
Returns all the concrete indices.
|
String[] |
concreteAllOpenIndices() |
String[] |
concreteIndices(IndicesOptions indicesOptions,
String... aliasesOrIndices)
Translates the provided indices or aliases, eventually containing wildcard expressions, into actual indices.
|
String[] |
concreteIndices(String[] indices)
Deprecated.
use
concreteIndices(org.elasticsearch.action.support.IndicesOptions, String...) instead and
be explicit about indices options to be used for indices resolution |
String |
concreteSingleIndex(String indexOrAlias,
IndicesOptions indicesOptions)
Utility method that allows to resolve an index or alias to its corresponding single concrete index.
|
String[] |
convertFromWildcards(String[] aliasesOrIndices,
IndicesOptions indicesOptions)
Converts a list of indices or aliases wildcards, and special +/- signs, into their respective full matches.
|
<T extends MetaData.Custom> |
custom(String type) |
ImmutableOpenMap<String,MetaData.Custom> |
customs() |
String[] |
filteringAliases(String index,
String... indicesOrAliases)
Iterates through the list of indices and selects the effective list of filtering aliases for the
given index.
|
ImmutableOpenMap<String,com.google.common.collect.ImmutableList<AliasMetaData>> |
findAliases(String[] aliases,
String[] concreteIndices)
Finds the specific index aliases that match with the specified aliases directly or partially via wildcards and
that point to the specified concrete indices or match partially with the indices via wildcards.
|
ImmutableOpenMap<String,ImmutableOpenMap<String,MappingMetaData>> |
findMappings(String[] concreteIndices,
String[] types) |
ImmutableOpenMap<String,com.google.common.collect.ImmutableList<IndexWarmersMetaData.Entry>> |
findWarmers(String[] concreteIndices,
String[] types,
String[] uncheckedWarmers) |
ImmutableOpenMap<String,ImmutableOpenMap<String,AliasMetaData>> |
getAliases() |
String[] |
getConcreteAllClosedIndices() |
String[] |
getConcreteAllIndices() |
String[] |
getConcreteAllOpenIndices() |
ImmutableOpenMap<String,MetaData.Custom> |
getCustoms() |
ImmutableOpenMap<String,IndexMetaData> |
getIndices() |
int |
getNumberOfShards() |
ImmutableOpenMap<String,IndexTemplateMetaData> |
getTemplates() |
int |
getTotalNumberOfShards() |
boolean |
hasAliases(String[] aliases,
String[] concreteIndices)
Checks if at least one of the specified aliases exists in the specified concrete indices.
|
boolean |
hasConcreteIndex(String index) |
boolean |
hasIndex(String index) |
IndexMetaData |
index(String index) |
ImmutableOpenMap<String,IndexMetaData> |
indices() |
static boolean |
isAllIndices(String[] aliasesOrIndices)
Identifies whether the array containing index names given as argument refers to all indices
The empty or null array identifies all indices
|
boolean |
isAllTypes(String[] types)
Identifies whether the array containing type names given as argument refers to all types
The empty or null array identifies all types
|
static boolean |
isExplicitAllPattern(String[] aliasesOrIndices)
Identifies whether the array containing index names given as argument explicitly refers to all indices
The empty or null array doesn't explicitly map to all indices
|
static boolean |
isGlobalStateEquals(MetaData metaData1,
MetaData metaData2) |
boolean |
isPatternMatchingAllIndices(String[] indicesOrAliases,
String[] concreteIndices)
Identifies whether the first argument (an array containing index names) is a pattern that matches all indices
|
com.google.common.collect.UnmodifiableIterator<IndexMetaData> |
iterator() |
static <T extends MetaData.Custom> |
lookupFactory(String type) |
static <T extends MetaData.Custom> |
lookupFactorySafe(String type) |
int |
numberOfShards() |
Settings |
persistentSettings() |
static void |
registerFactory(String type,
MetaData.Custom.Factory factory)
Register a custom index meta data factory.
|
String |
resolveIndexRouting(String routing,
String aliasOrIndex)
Returns indexing routing for the given index.
|
Map<String,Set<String>> |
resolveSearchRouting(String routing,
String aliasOrIndex) |
Map<String,Set<String>> |
resolveSearchRouting(String routing,
String[] aliasesOrIndices) |
boolean |
routingRequired(String concreteIndex,
String type) |
Settings |
settings()
Returns the merges transient and persistent settings.
|
ImmutableOpenMap<String,IndexTemplateMetaData> |
templates() |
int |
totalNumberOfShards() |
Settings |
transientSettings() |
String |
uuid() |
long |
version() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static final String ALL
public static EnumSet<MetaData.XContentContext> API_ONLY
public static EnumSet<MetaData.XContentContext> API_AND_GATEWAY
public static EnumSet<MetaData.XContentContext> API_AND_SNAPSHOT
public static Map<String,MetaData.Custom.Factory> customFactories
public static final String SETTING_READ_ONLY
public static final ClusterBlock CLUSTER_READ_ONLY_BLOCK
public static final MetaData EMPTY_META_DATA
public static final String CONTEXT_MODE_PARAM
public static final String CONTEXT_MODE_SNAPSHOT
public static final String CONTEXT_MODE_GATEWAY
public static void registerFactory(String type, MetaData.Custom.Factory factory)
@Nullable public static <T extends MetaData.Custom> MetaData.Custom.Factory<T> lookupFactory(String type)
public static <T extends MetaData.Custom> MetaData.Custom.Factory<T> lookupFactorySafe(String type) throws ElasticsearchIllegalArgumentException
public long version()
public String uuid()
public Settings settings()
public Settings transientSettings()
public Settings persistentSettings()
public ImmutableOpenMap<String,ImmutableOpenMap<String,AliasMetaData>> aliases()
public ImmutableOpenMap<String,ImmutableOpenMap<String,AliasMetaData>> getAliases()
public ImmutableOpenMap<String,com.google.common.collect.ImmutableList<AliasMetaData>> findAliases(String[] aliases, String[] concreteIndices)
aliases
- The names of the index aliases to findconcreteIndices
- The concrete indexes the index aliases must point to order to be returned.public boolean hasAliases(String[] aliases, String[] concreteIndices)
aliases
- The names of the index aliases to findconcreteIndices
- The concrete indexes the index aliases must point to order to be returned.public ImmutableOpenMap<String,ImmutableOpenMap<String,MappingMetaData>> findMappings(String[] concreteIndices, String[] types)
public ImmutableOpenMap<String,com.google.common.collect.ImmutableList<IndexWarmersMetaData.Entry>> findWarmers(String[] concreteIndices, String[] types, String[] uncheckedWarmers)
public String[] concreteAllIndices()
public String[] getConcreteAllIndices()
public String[] concreteAllOpenIndices()
public String[] getConcreteAllOpenIndices()
public String[] concreteAllClosedIndices()
public String[] getConcreteAllClosedIndices()
public String resolveIndexRouting(@Nullable String routing, String aliasOrIndex)
public Map<String,Set<String>> resolveSearchRouting(@Nullable String routing, String aliasOrIndex)
public Map<String,Set<String>> resolveSearchRouting(@Nullable String routing, String[] aliasesOrIndices)
@Deprecated public String[] concreteIndices(String[] indices) throws IndexMissingException
concreteIndices(org.elasticsearch.action.support.IndicesOptions, String...)
instead and
be explicit about indices options to be used for indices resolutionIndexMissingException
public String[] concreteIndices(IndicesOptions indicesOptions, String... aliasesOrIndices) throws IndexMissingException, ElasticsearchIllegalArgumentException
indicesOptions
- how the aliases or indices need to be resolved to concrete indicesaliasesOrIndices
- the aliases or indices to be resolved to concrete indicesIndexMissingException
- if one of the aliases or indices is missing and the provided indices options
don't allow such a case, or if the final result of the indices resolution is no indices and the indices options
don't allow such a case.ElasticsearchIllegalArgumentException
- if one of the aliases resolve to multiple indices and the provided
indices options don't allow such a case.public String concreteSingleIndex(String indexOrAlias, IndicesOptions indicesOptions) throws IndexMissingException, ElasticsearchIllegalArgumentException
IndicesOptions
that require a single index as a result. The indices resolution must in fact return a single index when
using this method, an ElasticsearchIllegalArgumentException
gets thrown otherwise.indexOrAlias
- the index or alias to be resolved to concrete indexindicesOptions
- the indices options to be used for the index resolutionIndexMissingException
- if the index or alias provided doesn't existElasticsearchIllegalArgumentException
- if the index resolution lead to more than one indexpublic String[] convertFromWildcards(String[] aliasesOrIndices, IndicesOptions indicesOptions)
public boolean hasIndex(String index)
public boolean hasConcreteIndex(String index)
public IndexMetaData index(String index)
public ImmutableOpenMap<String,IndexMetaData> indices()
public ImmutableOpenMap<String,IndexMetaData> getIndices()
public ImmutableOpenMap<String,IndexTemplateMetaData> templates()
public ImmutableOpenMap<String,IndexTemplateMetaData> getTemplates()
public ImmutableOpenMap<String,MetaData.Custom> customs()
public ImmutableOpenMap<String,MetaData.Custom> getCustoms()
public <T extends MetaData.Custom> T custom(String type)
public int totalNumberOfShards()
public int getTotalNumberOfShards()
public int numberOfShards()
public int getNumberOfShards()
public String[] filteringAliases(String index, String... indicesOrAliases)
Only aliases with filters are returned. If the indices list contains a non-filtering reference to the index itself - null is returned. Returns null if no filtering is required.
public static boolean isAllIndices(String[] aliasesOrIndices)
aliasesOrIndices
- the array containing index namespublic boolean isAllTypes(String[] types)
types
- the array containing index namespublic static boolean isExplicitAllPattern(String[] aliasesOrIndices)
aliasesOrIndices
- the array containing index namespublic boolean isPatternMatchingAllIndices(String[] indicesOrAliases, String[] concreteIndices)
indicesOrAliases
- the array containing index namesconcreteIndices
- array containing the concrete indices that the first argument refers topublic boolean routingRequired(String concreteIndex, String type)
concreteIndex
- The concrete index to check if routing is requiredtype
- The type to check if routing is requiredpublic com.google.common.collect.UnmodifiableIterator<IndexMetaData> iterator()
iterator
in interface Iterable<IndexMetaData>
public static boolean isGlobalStateEquals(MetaData metaData1, MetaData metaData2)
public static MetaData.Builder builder()
public static MetaData.Builder builder(MetaData metaData)
Copyright © 2009–2015. All rights reserved.