public class MetaData extends Objectimplements Iterable <IndexMetaData >
| Modifier and Type | Class and Description |
|---|---|
static class |
MetaData
|
static interface |
MetaData
|
static class |
MetaData
|
| Modifier and Type | Field and Description |
|---|---|
static String |
ALL
|
static EnumSet |
API_AND_GATEWAY
|
static EnumSet |
API_AND_SNAPSHOT
|
static EnumSet |
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 |
customFactories
|
static MetaData |
EMPTY_META_DATA
|
static String |
SETTING_READ_ONLY
|
| Modifier and Type | Method and Description |
|---|---|
ImmutableOpenMap |
aliases()
|
static MetaData |
builder()
|
static MetaData |
builder(MetaData
|
String |
concreteAllClosedIndices()
|
String |
concreteAllIndices()
Returns all the concrete indices.
|
String |
concreteAllOpenIndices()
|
String |
concreteIndices(IndicesOptions
Translates the provided indices or aliases, eventually containing wildcard expressions, into actual indices.
|
String |
concreteIndices(String
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
Utility method that allows to resolve an index or alias to its corresponding single concrete index.
|
String |
convertFromWildcards(String
Converts a list of indices or aliases wildcards, and special +/- signs, into their respective full matches.
|
<T extends MetaData |
custom(String
|
ImmutableOpenMap |
customs()
|
String |
filteringAliases(String
Iterates through the list of indices and selects the effective list of filtering aliases for the given index.
|
ImmutableOpenMap |
findAliases(String
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 |
findMappings(String
|
ImmutableOpenMap |
findWarmers(String
|
ImmutableOpenMap |
getAliases()
|
String |
getConcreteAllClosedIndices()
|
String |
getConcreteAllIndices()
|
String |
getConcreteAllOpenIndices()
|
ImmutableOpenMap |
getCustoms()
|
ImmutableOpenMap |
getIndices()
|
int |
getNumberOfShards()
|
ImmutableOpenMap |
getTemplates()
|
int |
getTotalNumberOfShards()
|
boolean |
hasAliases(String
Checks if at least one of the specified aliases exists in the specified concrete indices.
|
boolean |
hasConcreteIndex(String
|
boolean |
hasIndex(String
|
IndexMetaData |
index(String
|
ImmutableOpenMap |
indices()
|
static boolean |
isAllIndices(String
Identifies whether the array containing index names given as argument refers to all indices The empty or null array identifies all indices
|
static boolean |
isAllTypes(String
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
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
|
boolean |
isPatternMatchingAllIndices(String
Identifies whether the first argument (an array containing index names) is a pattern that matches all indices
|
<any> |
iterator()
|
static <T extends MetaData |
lookupFactory(String
|
static <T extends MetaData |
lookupFactorySafe(String
|
int |
numberOfShards()
|
Settings |
persistentSettings()
|
static void |
registerFactory(String
Register a custom index meta data factory.
|
String |
resolveIndexRouting(String
Returns indexing routing for the given index.
|
Map |
resolveSearchRouting(String
|
Map |
resolveSearchRouting(String
|
boolean |
routingRequired(String
|
Settings |
settings()
Returns the merges transient and persistent settings.
|
ImmutableOpenMap |
templates()
|
int |
totalNumberOfShards()
|
Settings |
transientSettings()
|
String |
uuid()
|
long |
version()
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic static final StringALL
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 StringSETTING_READ_ONLY
public static final ClusterBlockCLUSTER_READ_ONLY_BLOCK
public static final MetaDataEMPTY_META_DATA
public static final StringCONTEXT_MODE_PARAM
public static final StringCONTEXT_MODE_SNAPSHOT
public static final StringCONTEXT_MODE_GATEWAY
public static void registerFactory(Stringtype, 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 Stringuuid()
public Settingssettings()
public SettingstransientSettings()
public SettingspersistentSettings()
public ImmutableOpenMap<String ,ImmutableOpenMap <String ,AliasMetaData >> aliases()
public ImmutableOpenMap<String ,ImmutableOpenMap <String ,AliasMetaData >> getAliases()
public ImmutableOpenMap<String ,<any> > findAliases(String [] aliases, String [] concreteIndices)
aliases - The names of the index aliases to find
concreteIndices - 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 find
concreteIndices - 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 ,<any> > 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 StringresolveIndexRouting(@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 resolution
IndexMissingException
public String[] concreteIndices(IndicesOptions indicesOptions, String ... aliasesOrIndices) throws IndexMissingException , ElasticsearchIllegalArgumentException
indicesOptions - how the aliases or indices need to be resolved to concrete indices
aliasesOrIndices - the aliases or indices to be resolved to concrete indices
IndexMissingException - 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 StringconcreteSingleIndex(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 index
indicesOptions - the indices options to be used for the index resolution
IndexMissingException - if the index or alias provided doesn't exist
ElasticsearchIllegalArgumentException - if the index resolution lead to more than one index
public String[] convertFromWildcards(String [] aliasesOrIndices, IndicesOptions indicesOptions)
public boolean hasIndex(Stringindex)
public boolean hasConcreteIndex(Stringindex)
public IndexMetaDataindex(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 names
public static boolean isAllTypes(String[] types)
types - the array containing index names
public static boolean isExplicitAllPattern(String[] aliasesOrIndices)
aliasesOrIndices - the array containing index names
public boolean isPatternMatchingAllIndices(String[] indicesOrAliases, String [] concreteIndices)
indicesOrAliases - the array containing index names
concreteIndices - array containing the concrete indices that the first argument refers to
public boolean routingRequired(StringconcreteIndex, String type)
concreteIndex - The concrete index to check if routing is required
type - The type to check if routing is required
public <any> iterator()
public static boolean isGlobalStateEquals(MetaDatametaData1, MetaData metaData2)
public static MetaData.Builder builder()
public static MetaData.Builder builder(MetaData metaData)