Package org.apache.solr.cloud
Class ActiveReplicaWatcher
- java.lang.Object
-
- org.apache.solr.cloud.ActiveReplicaWatcher
-
- All Implemented Interfaces:
org.apache.solr.common.cloud.CollectionStateWatcher
public class ActiveReplicaWatcher extends Object implements org.apache.solr.common.cloud.CollectionStateWatcher
Watch for replicas to becomeReplica.State.ACTIVE
. Watcher is terminated (itsonStateChanged(Set, DocCollection)
method returns false) when all listed replicas become active.Additionally, the provided
SolrCloseableLatch
instance can be used to await for all listed replicas to become active.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<org.apache.solr.common.cloud.Replica>
getActiveReplicas()
Return the list of active replicas found so far.String
getCollection()
Collection name.List<String>
getReplicaIds()
Return the list of replica id-s that are not active yet (or unverified).List<String>
getSolrCoreNames()
Return a list of SolrCore names that are not active yet (or unverified).boolean
onStateChanged(Set<String> liveNodes, org.apache.solr.common.cloud.DocCollection collectionState)
String
toString()
-
-
-
Constructor Detail
-
ActiveReplicaWatcher
public ActiveReplicaWatcher(String collection, List<String> replicaIds, List<String> solrCoreNames, org.apache.solr.common.SolrCloseableLatch latch)
Construct the watcher. At least one replicaId or solrCoreName must be provided.- Parameters:
collection
- collection namereplicaIds
- list of replica id-ssolrCoreNames
- list of SolrCore nameslatch
- optional latch to await for all provided replicas to become active. This latch will be counted down by at most the number of provided replica id-s / SolrCore names.
-
-
Method Detail
-
getCollection
public String getCollection()
Collection name.
-
getActiveReplicas
public List<org.apache.solr.common.cloud.Replica> getActiveReplicas()
Return the list of active replicas found so far.
-
getReplicaIds
public List<String> getReplicaIds()
Return the list of replica id-s that are not active yet (or unverified).
-
getSolrCoreNames
public List<String> getSolrCoreNames()
Return a list of SolrCore names that are not active yet (or unverified).
-
-