public class MetaData extends Object implements Iterable<IndexMetaData>, Diffable<MetaData>, FromXContentBuilder<MetaData>, ToXContent
Modifier and Type | Class and Description |
---|---|
static class |
MetaData.Builder |
static interface |
MetaData.Custom |
static class |
MetaData.XContentContext |
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
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 Set<String> |
CLUSTER_BYTES_SIZE_SETTINGS
All known byte-sized cluster settings.
|
static ClusterBlock |
CLUSTER_READ_ONLY_BLOCK |
static Set<String> |
CLUSTER_TIME_SETTINGS
All known time cluster settings.
|
static String |
CONTEXT_MODE_GATEWAY |
static String |
CONTEXT_MODE_PARAM |
static String |
CONTEXT_MODE_SNAPSHOT |
static Map<String,MetaData.Custom> |
customPrototypes |
static MetaData |
EMPTY_META_DATA |
static MetaData |
PROTO |
static String |
SETTING_READ_ONLY |
EMPTY_PARAMS
Modifier and Type | Method and Description |
---|---|
static MetaData |
addDefaultUnitsIfNeeded(ESLogger logger,
MetaData metaData)
As of 2.0 we require units for time and byte-sized settings.
|
static Settings |
addDefaultUnitsIfNeeded(Set<String> timeSettings,
Set<String> byteSettings,
ESLogger logger,
Settings settings)
As of 2.0 we require units for time and byte-sized settings.
|
static MetaData.Builder |
builder() |
static MetaData.Builder |
builder(MetaData metaData) |
String |
clusterUUID() |
String[] |
concreteAllClosedIndices() |
String[] |
concreteAllIndices()
Returns all the concrete indices.
|
String[] |
concreteAllOpenIndices() |
<T extends MetaData.Custom> |
custom(String type) |
ImmutableOpenMap<String,MetaData.Custom> |
customs() |
Diff<MetaData> |
diff(MetaData previousState)
Returns serializable object representing differences between this and previousState
|
boolean |
equalsAliases(MetaData other) |
ImmutableOpenMap<String,List<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,List<IndexWarmersMetaData.Entry>> |
findWarmers(String[] concreteIndices,
String[] types,
String[] uncheckedWarmers) |
MetaData |
fromXContent(XContentParser parser,
ParseFieldMatcher parseFieldMatcher)
Parses an object with the type T from parser
|
SortedMap<String,AliasOrIndex> |
getAliasAndIndexLookup() |
String[] |
getConcreteAllClosedIndices() |
String[] |
getConcreteAllIndices() |
String[] |
getConcreteAllOpenIndices() |
ImmutableOpenMap<String,MetaData.Custom> |
getCustoms() |
ImmutableOpenMap<String,IndexMetaData> |
getIndices() |
int |
getNumberOfShards() |
ImmutableOpenMap<String,IndexTemplateMetaData> |
getTemplates() |
int |
getTotalNumberOfShards() |
boolean |
hasAlias(String alias) |
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 |
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 |
isExplicitAllType(String[] types)
Identifies whether the array containing type names given as argument explicitly refers to all types
The empty or null array doesn't explicitly map to all types
|
static boolean |
isGlobalStateEquals(MetaData metaData1,
MetaData metaData2) |
com.google.common.collect.UnmodifiableIterator<IndexMetaData> |
iterator() |
static <T extends MetaData.Custom> |
lookupPrototype(String type) |
static <T extends MetaData.Custom> |
lookupPrototypeSafe(String type) |
int |
numberOfShards() |
Settings |
persistentSettings() |
Diff<MetaData> |
readDiffFrom(StreamInput in)
Reads the
Diff from StreamInput |
MetaData |
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,
MetaData.Custom proto)
Register a custom index meta data factory.
|
String |
resolveIndexRouting(String routing,
String aliasOrIndex)
Returns indexing routing for the given index.
|
boolean |
routingRequired(String concreteIndex,
String type) |
Settings |
settings()
Returns the merged transient and persistent settings.
|
ImmutableOpenMap<String,IndexTemplateMetaData> |
templates() |
int |
totalNumberOfShards() |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
Settings |
transientSettings() |
long |
version() |
void |
writeTo(StreamOutput out)
Writes the current object into the output stream out
|
public static final MetaData PROTO
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> customPrototypes
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 final Set<String> CLUSTER_BYTES_SIZE_SETTINGS
public static void registerPrototype(String type, MetaData.Custom proto)
@Nullable public static <T extends MetaData.Custom> T lookupPrototype(String type)
public static <T extends MetaData.Custom> T lookupPrototypeSafe(String type)
public long version()
public String clusterUUID()
public Settings settings()
public Settings transientSettings()
public Settings persistentSettings()
public boolean hasAlias(String alias)
public boolean equalsAliases(MetaData other)
public SortedMap<String,AliasOrIndex> getAliasAndIndexLookup()
public ImmutableOpenMap<String,List<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,List<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 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 static boolean isAllTypes(String[] types)
types
- the array containing typespublic static boolean isExplicitAllType(String[] types)
types
- the array containing index namespublic 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 Diff<MetaData> diff(MetaData previousState)
Diffable
public Diff<MetaData> readDiffFrom(StreamInput in) throws IOException
Diffable
Diff
from StreamInputreadDiffFrom
in interface Diffable<MetaData>
IOException
public MetaData fromXContent(XContentParser parser, ParseFieldMatcher parseFieldMatcher) throws IOException
FromXContentBuilder
fromXContent
in interface FromXContentBuilder<MetaData>
IOException
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
toXContent
in interface ToXContent
IOException
public MetaData readFrom(StreamInput in) throws IOException
StreamableReader
readFrom
in interface StreamableReader<MetaData>
IOException
public void writeTo(StreamOutput out) throws IOException
Writeable
writeTo
in interface Writeable<MetaData>
IOException
public static MetaData.Builder builder()
public static MetaData.Builder builder(MetaData metaData)
@Nullable public static Settings addDefaultUnitsIfNeeded(Set<String> timeSettings, Set<String> byteSettings, ESLogger logger, Settings settings)
Copyright © 2009–2016. All rights reserved.