: involves a sleep period.  We use it in many places.  IMO it's a sad
: choice to use when it's possible to alternatively wait on a condition
: that will wake up the thread.  Those who have touched SolrCloud should
: be aware of ZkStateReader.waitForState, a specific alternative I have
: in mind.

Yes please -- waitForState (espeically the version that takes in a 
Predicate<DocCollection> so it doesn't have to also pay attention to 
liveNodes) is vastly superioor to TimeOut & polling.


: Say for example, in CreateCollectionCmd

Your suggested change is good, but it can be even better -- after the 
TimeOut code you suggested replacing, the existing CreateCollectionCmd 
does this...

// refresh cluster state (value read below comes from Zookeeper watch firing 
following the
// update done previously, be it by Overseer or by this thread when updates are 
distributed)
clusterState = ccc.getSolrCloudManager().getClusterState();
newColl = clusterState.getCollection(collectionName);


...but the waitForState version can just literally use...

newColl = zkStateReader.waitForState(...)



-Hoss
http://www.lucidworks.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@solr.apache.org
For additional commands, e-mail: dev-h...@solr.apache.org

Reply via email to