Same for me. I don't see a reason (may be unit test?) to do that.
Wait for yellow in Java could be done like this:
node.client().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet();
HTH
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr
Le 27 novembre 2013 at 15:53:34, Nikolas Everett (nik9000@gmail.com) a écrit:
I can't think of a good reason you'd want to close immediately but if you really do the simplest thing is to wait for the cluster health to turn yellow. You can be more careful and just wait for the index health to turn yellow but I don't know if there is a simple wait api for that. There is for cluster state:
$ curl -XGET 'http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=50s'
You can run the same thing in Java code, I'm sure.
On Wed, Nov 27, 2013 at 9:48 AM, Stefan Meiwald st.meiwald@gmail.com wrote:
Hey,
I am wondering if there is a way to wait for the Primary Shard Allocation before I try to close an Index with the Java API. My usecase is to create an index and close it immediately afterwards.
If I run both Java statements in a direct sequence I get often the Exception: class org.elasticsearch.indices.IndexPrimaryShardNotAllocatedException
Is there any way to wait for the primary shard allocation when I try to close the Index? Something like setRefresh(true) when indexing new documents?
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/52f4dee3-5fa9-46e3-a824-513c04afd60e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAPmjWd3s%2B2MGEfbjKX9YGFqpNvUVcmDFrUsDaqtZjqwDLP%2Batg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/etPan.5296080d.519b500d.3e14%40MacBook-Air-de-David.local.
For more options, visit https://groups.google.com/groups/opt_out.