org.elasticsearch.cluster.metadata
Class IndexMetaData

java.lang.Object
  extended by org.elasticsearch.cluster.metadata.IndexMetaData

public class IndexMetaData
extends Object


Nested Class Summary
static class IndexMetaData.Builder
           
static interface IndexMetaData.Custom
           
static class IndexMetaData.State
           
 
Field Summary
static Map<String,IndexMetaData.Custom.Factory> customFactories
           
static ClusterBlock INDEX_METADATA_BLOCK
           
static ClusterBlock INDEX_READ_BLOCK
           
static ClusterBlock INDEX_READ_ONLY_BLOCK
           
static ClusterBlock INDEX_WRITE_BLOCK
           
static String SETTING_AUTO_EXPAND_REPLICAS
           
static String SETTING_BLOCKS_METADATA
           
static String SETTING_BLOCKS_READ
           
static String SETTING_BLOCKS_WRITE
           
static String SETTING_NUMBER_OF_REPLICAS
           
static String SETTING_NUMBER_OF_SHARDS
           
static String SETTING_READ_ONLY
           
static String SETTING_VERSION_CREATED
           
 
Method Summary
static void addDynamicSettings(String... settings)
           
 com.google.common.collect.ImmutableMap<String,AliasMetaData> aliases()
           
static IndexMetaData.Builder builder(String index)
           
<T extends IndexMetaData.Custom>
T
custom(String type)
           
 com.google.common.collect.ImmutableMap<String,IndexMetaData.Custom> customs()
           
static com.google.common.collect.ImmutableSet<String> dynamicSettings()
           
 boolean equals(Object o)
           
 DiscoveryNodeFilters excludeFilters()
           
 com.google.common.collect.ImmutableMap<String,AliasMetaData> getAliases()
           
 com.google.common.collect.ImmutableMap<String,IndexMetaData.Custom> getCustoms()
           
 String getIndex()
           
 com.google.common.collect.ImmutableMap<String,MappingMetaData> getMappings()
           
 int getNumberOfReplicas()
           
 int getNumberOfShards()
           
 Settings getSettings()
           
 IndexMetaData.State getState()
           
 int getTotalNumberOfShards()
           
 long getVersion()
           
static boolean hasDynamicSetting(String key)
           
 int hashCode()
           
 DiscoveryNodeFilters includeFilters()
           
 String index()
           
static
<T extends IndexMetaData.Custom>
IndexMetaData.Custom.Factory<T>
lookupFactory(String type)
           
static
<T extends IndexMetaData.Custom>
IndexMetaData.Custom.Factory<T>
lookupFactorySafe(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.
 com.google.common.collect.ImmutableMap<String,MappingMetaData> mappings()
           
static IndexMetaData.Builder newIndexMetaDataBuilder(IndexMetaData indexMetaData)
           
static IndexMetaData.Builder newIndexMetaDataBuilder(String index)
           
 int numberOfReplicas()
           
 int numberOfShards()
           
static void registerFactory(String type, IndexMetaData.Custom.Factory factory)
          Register a custom index meta data factory.
 Settings settings()
           
 IndexMetaData.State state()
           
 int totalNumberOfShards()
           
 long version()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

customFactories

public static Map<String,IndexMetaData.Custom.Factory> customFactories

INDEX_READ_ONLY_BLOCK

public static final ClusterBlock INDEX_READ_ONLY_BLOCK

INDEX_READ_BLOCK

public static final ClusterBlock INDEX_READ_BLOCK

INDEX_WRITE_BLOCK

public static final ClusterBlock INDEX_WRITE_BLOCK

INDEX_METADATA_BLOCK

public static final ClusterBlock INDEX_METADATA_BLOCK

SETTING_NUMBER_OF_SHARDS

public static final String SETTING_NUMBER_OF_SHARDS
See Also:
Constant Field Values

SETTING_NUMBER_OF_REPLICAS

public static final String SETTING_NUMBER_OF_REPLICAS
See Also:
Constant Field Values

SETTING_AUTO_EXPAND_REPLICAS

public static final String SETTING_AUTO_EXPAND_REPLICAS
See Also:
Constant Field Values

SETTING_READ_ONLY

public static final String SETTING_READ_ONLY
See Also:
Constant Field Values

SETTING_BLOCKS_READ

public static final String SETTING_BLOCKS_READ
See Also:
Constant Field Values

SETTING_BLOCKS_WRITE

public static final String SETTING_BLOCKS_WRITE
See Also:
Constant Field Values

SETTING_BLOCKS_METADATA

public static final String SETTING_BLOCKS_METADATA
See Also:
Constant Field Values

SETTING_VERSION_CREATED

public static final String SETTING_VERSION_CREATED
See Also:
Constant Field Values
Method Detail

registerFactory

public static void registerFactory(String type,
                                   IndexMetaData.Custom.Factory factory)
Register a custom index meta data factory. Make sure to call it from a static block.


lookupFactory

@Nullable
public static <T extends IndexMetaData.Custom> IndexMetaData.Custom.Factory<T> lookupFactory(String type)

lookupFactorySafe

public static <T extends IndexMetaData.Custom> IndexMetaData.Custom.Factory<T> lookupFactorySafe(String type)
                                                                                      throws ElasticSearchIllegalArgumentException
Throws:
ElasticSearchIllegalArgumentException

dynamicSettings

public static com.google.common.collect.ImmutableSet<String> dynamicSettings()

hasDynamicSetting

public static boolean hasDynamicSetting(String key)

addDynamicSettings

public static void addDynamicSettings(String... settings)

index

public String index()

getIndex

public String getIndex()

version

public long version()

getVersion

public long getVersion()

state

public IndexMetaData.State state()

getState

public IndexMetaData.State getState()

numberOfShards

public int numberOfShards()

getNumberOfShards

public int getNumberOfShards()

numberOfReplicas

public int numberOfReplicas()

getNumberOfReplicas

public int getNumberOfReplicas()

totalNumberOfShards

public int totalNumberOfShards()

getTotalNumberOfShards

public int getTotalNumberOfShards()

settings

public Settings settings()

getSettings

public Settings getSettings()

aliases

public com.google.common.collect.ImmutableMap<String,AliasMetaData> aliases()

getAliases

public com.google.common.collect.ImmutableMap<String,AliasMetaData> getAliases()

mappings

public com.google.common.collect.ImmutableMap<String,MappingMetaData> mappings()

getMappings

public com.google.common.collect.ImmutableMap<String,MappingMetaData> getMappings()

mapping

@Nullable
public MappingMetaData mapping(String mappingType)

mappingOrDefault

@Nullable
public 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.

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.


customs

public com.google.common.collect.ImmutableMap<String,IndexMetaData.Custom> customs()

getCustoms

public com.google.common.collect.ImmutableMap<String,IndexMetaData.Custom> getCustoms()

custom

public <T extends IndexMetaData.Custom> T custom(String type)

includeFilters

@Nullable
public DiscoveryNodeFilters includeFilters()

excludeFilters

@Nullable
public DiscoveryNodeFilters excludeFilters()

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

builder

public static IndexMetaData.Builder builder(String index)

newIndexMetaDataBuilder

public static IndexMetaData.Builder newIndexMetaDataBuilder(String index)

newIndexMetaDataBuilder

public static IndexMetaData.Builder newIndexMetaDataBuilder(IndexMetaData indexMetaData)


Copyright © 2009-2012. All Rights Reserved.