Package org.elasticsearch.indices
Class SystemIndexDescriptor
java.lang.Object
org.elasticsearch.indices.SystemIndexDescriptor
public class SystemIndexDescriptor
extends java.lang.Object
A system index descriptor describes one or more system indices. It can match a number of indices using
a pattern. For system indices that are managed externally to Elasticsearch, this is enough. For system
indices that are managed internally to Elasticsearch, a descriptor can also include information for
creating the system index, upgrading its mappings, and creating an alias.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SystemIndexDescriptor.Builder
Provides a fluent API for building aSystemIndexDescriptor
. -
Constructor Summary
Constructors Constructor Description SystemIndexDescriptor(java.lang.String indexPattern, java.lang.String description)
Creates a descriptor for system indices matching the supplied pattern. -
Method Summary
Modifier and Type Method Description static SystemIndexDescriptor.Builder
builder()
java.lang.String
checkMinimumNodeVersion(java.lang.String cause, Version actualMinimumNodeVersion)
Checks that this descriptor can be used within this cluster e.g.java.lang.String
getAliasName()
java.lang.String
getDescription()
int
getIndexFormat()
java.lang.String
getIndexPattern()
java.lang.String
getIndexType()
java.lang.String
getMappings()
java.util.List<java.lang.String>
getMatchingIndices(Metadata metadata)
Retrieves a list of all indices which match this descriptor's pattern.java.lang.String
getOrigin()
java.lang.String
getPrimaryIndex()
Settings
getSettings()
java.lang.String
getVersionMetaKey()
boolean
isAutomaticallyManaged()
boolean
matchesIndexPattern(java.lang.String index)
Checks whether an index name matches the system index name pattern for this descriptor.java.lang.String
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
SystemIndexDescriptor
public SystemIndexDescriptor(java.lang.String indexPattern, java.lang.String description)Creates a descriptor for system indices matching the supplied pattern. These indices will not be managed by Elasticsearch internally.- Parameters:
indexPattern
- The pattern of index names that this descriptor will be used for. Must start with a '.' character.description
- The name of the plugin responsible for this system index.
-
-
Method Details
-
getIndexPattern
public java.lang.String getIndexPattern()- Returns:
- The pattern of index names that this descriptor will be used for.
-
getPrimaryIndex
public java.lang.String getPrimaryIndex()- Returns:
- The concrete name of an index being managed internally to Elasticsearch. Will be
null
for indices managed externally to Elasticsearch.
-
matchesIndexPattern
public boolean matchesIndexPattern(java.lang.String index)Checks whether an index name matches the system index name pattern for this descriptor.- Parameters:
index
- The index name to be checked against the index pattern given at construction time.- Returns:
- True if the name matches the pattern, false otherwise.
-
getMatchingIndices
Retrieves a list of all indices which match this descriptor's pattern. This cannot be done viaIndexNameExpressionResolver
because that class can only handle simple wildcard expressions, but system index name patterns may use full Lucene regular expression syntax,- Parameters:
metadata
- The current metadata to get the list of matching indices from- Returns:
- A list of index names that match this descriptor
-
getDescription
public java.lang.String getDescription()- Returns:
- A short description of the purpose of this system index.
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
getMappings
public java.lang.String getMappings() -
getSettings
-
getAliasName
public java.lang.String getAliasName() -
getIndexFormat
public int getIndexFormat() -
getVersionMetaKey
public java.lang.String getVersionMetaKey() -
isAutomaticallyManaged
public boolean isAutomaticallyManaged() -
getOrigin
public java.lang.String getOrigin() -
getIndexType
public java.lang.String getIndexType() -
checkMinimumNodeVersion
public java.lang.String checkMinimumNodeVersion(java.lang.String cause, Version actualMinimumNodeVersion)Checks that this descriptor can be used within this cluster e.g. the cluster supports all required features, by comparing the supplied minimum node version to this descriptor's minimum version.- Parameters:
cause
- the action being attempted that triggered the check. Used in the error message.actualMinimumNodeVersion
- the lower node version in the cluster- Returns:
- an error message if the lowest node version is lower that the version in this descriptor,
or
null
if the supplied version is acceptable or this descriptor has no minimum version.
-
builder
-