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
public class PerReplicaStates extends Object implements ReflectMapWriter
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 Classes Modifier and Type Class Description static class
PerReplicaStates.Operation
static class
PerReplicaStates.State
The state of a replica as stored as a node under /collections/collection-name/state.json/replica-state-
Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriter
MapWriter.EntryWriter
-
-
Field Summary
Fields Modifier and Type Field Description int
cversion
static int
MAX_RETRIES
String
path
static char
SEPARATOR
SimpleMap<PerReplicaStates.State>
states
-
Constructor Summary
Constructors Constructor Description PerReplicaStates(String path, int cversion, List<String> states)
Construct with data read from ZK
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allActive()
Check and return if all replicas are ACTIVEstatic PerReplicaStates
empty(String collectionName)
static Set<String>
findModifiedReplicas(PerReplicaStates old, PerReplicaStates fresh)
Get the changed replicasPerReplicaStates.State
get(String replica)
static String
getReplicaName(String s)
String
toString()
void
writeMap(MapWriter.EntryWriter ew)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.solr.common.NavigableObject
_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr, _size
-
-
-
-
Field Detail
-
SEPARATOR
public static final char SEPARATOR
- See Also:
- Constant Field Values
-
MAX_RETRIES
public static final int MAX_RETRIES
- See Also:
- Constant Field Values
-
path
public final String path
-
cversion
public final int cversion
-
states
public final SimpleMap<PerReplicaStates.State> states
-
-
Method Detail
-
empty
public static PerReplicaStates empty(String collectionName)
-
allActive
public boolean allActive()
Check and return if all replicas are ACTIVE
-
findModifiedReplicas
public static Set<String> findModifiedReplicas(PerReplicaStates old, PerReplicaStates fresh)
Get the changed replicas
-
get
public PerReplicaStates.State get(String replica)
-
writeMap
public void writeMap(MapWriter.EntryWriter ew) throws IOException
- Specified by:
writeMap
in interfaceMapWriter
- Specified by:
writeMap
in interfaceReflectMapWriter
- Throws:
IOException
-
-