Package org.apache.solr.common.cloud
Class PerReplicaStates
java.lang.Object
org.apache.solr.common.cloud.PerReplicaStates
- All Implemented Interfaces:
MapSerializable,MapWriter,NavigableObject,ReflectMapWriter,org.noggit.JSONWriter.Writable
This represents the individual replica states in a collection This is an immutable object. When
states are modified, a new instance is constructed
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classThe state of a replica as stored as a node under /collections/collection-name/state.json/replica-stateNested classes/interfaces inherited from interface org.apache.solr.common.MapWriter
MapWriter.EntryWriter -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal intstatic final intfinal Stringstatic final charfinal Map<String, PerReplicaStates.State> -
Constructor Summary
ConstructorsConstructorDescriptionPerReplicaStates(String path, int cversion, List<String> states) Construct with data read from ZK -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck and return if all replicas are ACTIVEstatic PerReplicaStatesfindModifiedReplicas(PerReplicaStates old, PerReplicaStates fresh) Get the changed replicasstatic StringtoString()voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.solr.common.NavigableObject
_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _get, _getStr, _getStr, _getStr, _size
-
Field Details
-
SEPARATOR
public static final char SEPARATOR- See Also:
-
MAX_RETRIES
public static final int MAX_RETRIES- See Also:
-
path
-
cversion
public final int cversion -
states
-
-
Constructor Details
-
PerReplicaStates
Construct with data read from ZK- Parameters:
path- path from where this is loadedcversion- the current child version of the znodestates- the per-replica states (the list of all child nodes)
-
-
Method Details
-
empty
-
allActive
public boolean allActive()Check and return if all replicas are ACTIVE -
findModifiedReplicas
Get the changed replicas -
getReplicaName
-
get
-
toString
-
writeMap
- Specified by:
writeMapin interfaceMapWriter- Specified by:
writeMapin interfaceReflectMapWriter- Throws:
IOException
-