public class ActiveReplicaWatcher extends Object implements CollectionStateWatcher
Replica.State.ACTIVE
. Watcher is
terminated (its onStateChanged(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.
Constructor and Description |
---|
ActiveReplicaWatcher(String collection,
List<String> replicaIds,
List<String> solrCoreNames,
SolrCloseableLatch latch)
Construct the watcher.
|
Modifier and Type | Method and Description |
---|---|
List<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,
DocCollection collectionState) |
String |
toString() |
public ActiveReplicaWatcher(String collection, List<String> replicaIds, List<String> solrCoreNames, SolrCloseableLatch latch)
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.public String getCollection()
public List<Replica> getActiveReplicas()
public List<String> getReplicaIds()
public List<String> getSolrCoreNames()
public boolean onStateChanged(Set<String> liveNodes, DocCollection collectionState)
onStateChanged
in interface CollectionStateWatcher
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.