org.elasticsearch.cluster
Class ClusterState

java.lang.Object
  extended by org.elasticsearch.cluster.ClusterState
All Implemented Interfaces:
ToXContent

public class ClusterState
extends Object
implements ToXContent


Nested Class Summary
static class ClusterState.Builder
           
static interface ClusterState.Custom
           
 
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.MapParams, ToXContent.Params
 
Field Summary
static Map<String,ClusterState.Custom.Factory> customFactories
           
 
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
 
Constructor Summary
ClusterState(long version, ClusterState state)
           
ClusterState(long version, MetaData metaData, RoutingTable routingTable, DiscoveryNodes nodes, ClusterBlocks blocks, AllocationExplanation allocationExplanation, com.google.common.collect.ImmutableMap<String,ClusterState.Custom> customs)
           
 
Method Summary
 AllocationExplanation allocationExplanation()
           
 ClusterBlocks blocks()
           
static ClusterState.Builder builder()
           
 com.google.common.collect.ImmutableMap<String,ClusterState.Custom> customs()
           
 AllocationExplanation getAllocationExplanation()
           
 ClusterBlocks getBlocks()
           
 com.google.common.collect.ImmutableMap<String,ClusterState.Custom> getCustoms()
           
 MetaData getMetaData()
           
 DiscoveryNodes getNodes()
           
 RoutingNodes getRoutingNodes()
           
 RoutingTable getRoutingTable()
           
 long getVersion()
           
static
<T extends ClusterState.Custom>
ClusterState.Custom.Factory<T>
lookupFactory(String type)
           
static
<T extends ClusterState.Custom>
ClusterState.Custom.Factory<T>
lookupFactorySafe(String type)
           
 MetaData metaData()
           
static ClusterState.Builder newClusterStateBuilder()
           
 DiscoveryNodes nodes()
           
 RoutingNodes readOnlyRoutingNodes()
          Returns a built (on demand) routing nodes view of the routing table.
static void registerFactory(String type, ClusterState.Custom.Factory factory)
          Register a custom index meta data factory.
 RoutingNodes routingNodes()
           
 RoutingTable routingTable()
           
 ClusterState settingsFilter(SettingsFilter settingsFilter)
           
 XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params)
           
 long version()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

customFactories

public static Map<String,ClusterState.Custom.Factory> customFactories
Constructor Detail

ClusterState

public ClusterState(long version,
                    ClusterState state)

ClusterState

public ClusterState(long version,
                    MetaData metaData,
                    RoutingTable routingTable,
                    DiscoveryNodes nodes,
                    ClusterBlocks blocks,
                    AllocationExplanation allocationExplanation,
                    com.google.common.collect.ImmutableMap<String,ClusterState.Custom> customs)
Method Detail

registerFactory

public static void registerFactory(String type,
                                   ClusterState.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 ClusterState.Custom> ClusterState.Custom.Factory<T> lookupFactory(String type)

lookupFactorySafe

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

version

public long version()

getVersion

public long getVersion()

nodes

public DiscoveryNodes nodes()

getNodes

public DiscoveryNodes getNodes()

metaData

public MetaData metaData()

getMetaData

public MetaData getMetaData()

routingTable

public RoutingTable routingTable()

getRoutingTable

public RoutingTable getRoutingTable()

routingNodes

public RoutingNodes routingNodes()

getRoutingNodes

public RoutingNodes getRoutingNodes()

blocks

public ClusterBlocks blocks()

getBlocks

public ClusterBlocks getBlocks()

allocationExplanation

public AllocationExplanation allocationExplanation()

getAllocationExplanation

public AllocationExplanation getAllocationExplanation()

customs

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

getCustoms

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

readOnlyRoutingNodes

public RoutingNodes readOnlyRoutingNodes()
Returns a built (on demand) routing nodes view of the routing table. NOTE, the routing nodes are mutable, use them just for read operations


settingsFilter

public ClusterState settingsFilter(SettingsFilter settingsFilter)

toXContent

public XContentBuilder toXContent(XContentBuilder builder,
                                  ToXContent.Params params)
                           throws IOException
Specified by:
toXContent in interface ToXContent
Throws:
IOException

builder

public static ClusterState.Builder builder()

newClusterStateBuilder

public static ClusterState.Builder newClusterStateBuilder()


Copyright © 2009-2012. All Rights Reserved.