Package org.apache.solr.common.cloud
Class Replica
- java.lang.Object
-
- org.apache.solr.common.cloud.ZkNodeProps
-
- org.apache.solr.common.cloud.Replica
-
- All Implemented Interfaces:
MapSerializable
,MapWriter
,NavigableObject
,org.noggit.JSONWriter.Writable
public class Replica extends ZkNodeProps implements MapWriter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Replica.ReplicaStateProps
JSON properties related to a replica's state.static class
Replica.State
The replica's state.static class
Replica.Type
-
Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriter
MapWriter.EntryWriter
-
-
Constructor Summary
Constructors Constructor Description Replica(String name, String node, String collection, String shard, String core, Replica.State state, Replica.Type type, Map<String,Object> props)
Replica(String name, Map<String,Object> map, String collection, String shard)
Replica(Map<String,Object> nestedMap)
This constructor uses a map with one key (coreNode name) and a value that is a map containing all replica properties.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
Replica
copyWith(PerReplicaStates.State state)
boolean
equals(Object o)
Object
get(String key, Object defValue)
String
getBaseUrl()
String
getCollection()
String
getCoreName()
SolrCore name.String
getCoreUrl()
String
getName()
Also known as coreNodeName.String
getNodeName()
The name of the node this replica resides onMap<String,Object>
getProperties()
Get all properties as map.String
getProperty(String propertyName)
PerReplicaStates.State
getReplicaState()
String
getShard()
Replica.State
getState()
Returns theReplica.State
of this replica.static Replica.State
getState(String shortName)
Replica.Type
getType()
int
hashCode()
boolean
isActive(Set<String> liveNodes)
boolean
isLeader()
void
setState(Replica.State state)
ZkNodeProps
toFullProps()
String
toString()
void
writeMap(MapWriter.EntryWriter ew)
-
Methods inherited from class org.apache.solr.common.cloud.ZkNodeProps
containsKey, fromKeyVals, get, getBool, getInt, getStr, getStr, keySet, load, plus, plus, shallowCopy
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.solr.common.NavigableObject
_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr, _size
-
-
-
-
Constructor Detail
-
Replica
public Replica(String name, String node, String collection, String shard, String core, Replica.State state, Replica.Type type, Map<String,Object> props)
-
-
Method Detail
-
getCollection
public String getCollection()
-
getShard
public String getShard()
-
getProperties
public Map<String,Object> getProperties()
Description copied from class:ZkNodeProps
Get all properties as map.- Overrides:
getProperties
in classZkNodeProps
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classZkNodeProps
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classZkNodeProps
-
getName
public String getName()
Also known as coreNodeName.
-
getCoreUrl
public String getCoreUrl()
-
getBaseUrl
public String getBaseUrl()
-
getCoreName
public String getCoreName()
SolrCore name.
-
getNodeName
public String getNodeName()
The name of the node this replica resides on
-
getState
public Replica.State getState()
Returns theReplica.State
of this replica.
-
setState
public void setState(Replica.State state)
-
getType
public Replica.Type getType()
-
isLeader
public boolean isLeader()
-
copyWith
public Replica copyWith(PerReplicaStates.State state)
-
getReplicaState
public PerReplicaStates.State getReplicaState()
-
getState
public static Replica.State getState(String shortName)
-
writeMap
public void writeMap(MapWriter.EntryWriter ew) throws IOException
- Specified by:
writeMap
in interfaceMapWriter
- Overrides:
writeMap
in classZkNodeProps
- Throws:
IOException
-
toString
public String toString()
- Overrides:
toString
in classZkNodeProps
-
toFullProps
public ZkNodeProps toFullProps()
-
-