|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.solr.common.cloud.ClusterState
public class ClusterState
Immutable state of the cloud. Normally you can get the state by using
ZkStateReader.getClusterState()
.
Constructor Summary | |
---|---|
ClusterState(Integer zkClusterStateVersion,
Set<String> liveNodes,
Map<String,DocCollection> collectionStates)
Deprecated. prefer another constructor |
|
ClusterState(Integer zkClusterStateVersion,
Set<String> liveNodes,
Map<String,DocCollection> collectionStates,
ZkStateReader stateReader)
Use this constr when ClusterState is meant for consumption. |
|
ClusterState(Set<String> liveNodes,
Map<String,DocCollection> collectionStates)
Use this constr when ClusterState is meant for publication. |
Method Summary | |
---|---|
ClusterState |
copyWith(Map<String,DocCollection> modified)
|
boolean |
equals(Object obj)
|
Collection<Slice> |
getActiveSlices(String collection)
|
Map<String,Slice> |
getActiveSlicesMap(String collection)
|
DocCollection |
getCollection(String collection)
Get the named DocCollection object, or throw an exception if it doesn't exist. |
DocCollection |
getCollectionOrNull(String collection)
|
Set<String> |
getCollections()
Get collection names. |
Map<String,DocCollection> |
getCollectionStates()
Deprecated. |
Replica |
getLeader(String collection,
String sliceName)
Get the lead replica for specific collection, or null if one currently doesn't exist. |
Set<String> |
getLiveNodes()
Get names of the currently live nodes. |
Replica |
getReplica(String collection,
String coreNodeName)
Gets the replica by the core name (assuming the slice is unknown) or null if replica is not found. |
String |
getShardId(String nodeName,
String coreName)
|
Slice |
getSlice(String collection,
String sliceName)
Get the named Slice for collection, or null if not found. |
Collection<Slice> |
getSlices(String collection)
|
Map<String,Slice> |
getSlicesMap(String collection)
|
Integer |
getZkClusterStateVersion()
The version of clusterstate.json in ZooKeeper. |
boolean |
hasCollection(String coll)
|
int |
hashCode()
|
boolean |
liveNodesContain(String name)
Check if node is alive. |
static Aliases |
load(byte[] bytes)
|
static ClusterState |
load(Integer version,
byte[] bytes,
Set<String> liveNodes,
ZkStateReader stateReader)
Create ClusterState from json string that is typically stored in zookeeper. |
static ClusterState |
load(SolrZkClient zkClient,
Set<String> liveNodes,
ZkStateReader stateReader)
Create ClusterState by reading the current state from zookeeper. |
String |
toString()
|
void |
write(org.noggit.JSONWriter jsonWriter)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ClusterState(Set<String> liveNodes, Map<String,DocCollection> collectionStates)
public ClusterState(Integer zkClusterStateVersion, Set<String> liveNodes, Map<String,DocCollection> collectionStates)
public ClusterState(Integer zkClusterStateVersion, Set<String> liveNodes, Map<String,DocCollection> collectionStates, ZkStateReader stateReader)
Method Detail |
---|
public ClusterState copyWith(Map<String,DocCollection> modified)
public Replica getLeader(String collection, String sliceName)
public Replica getReplica(String collection, String coreNodeName)
public boolean hasCollection(String coll)
public Slice getSlice(String collection, String sliceName)
public Map<String,Slice> getSlicesMap(String collection)
public Map<String,Slice> getActiveSlicesMap(String collection)
public Collection<Slice> getSlices(String collection)
public Collection<Slice> getActiveSlices(String collection)
public DocCollection getCollectionOrNull(String collection)
public DocCollection getCollection(String collection)
public Set<String> getCollections()
@Deprecated public Map<String,DocCollection> getCollectionStates()
public Set<String> getLiveNodes()
public String getShardId(String nodeName, String coreName)
public boolean liveNodesContain(String name)
public String toString()
toString
in class Object
public static ClusterState load(SolrZkClient zkClient, Set<String> liveNodes, ZkStateReader stateReader) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public static ClusterState load(Integer version, byte[] bytes, Set<String> liveNodes, ZkStateReader stateReader)
load(SolrZkClient, Set, ZkStateReader)
instead, unless you want to
do something more when getting the data - such as get the stat, set watch, etc.
version
- zk version of the clusterstate.json file (bytes)bytes
- clusterstate.json as a byte arrayliveNodes
- list of live nodes
public static Aliases load(byte[] bytes)
public void write(org.noggit.JSONWriter jsonWriter)
write
in interface org.noggit.JSONWriter.Writable
public Integer getZkClusterStateVersion()
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |