I assume that it's faster not to wait and send asynch and let the server process requests.
I can probably wait, but why have asynch then? There should be a way to check if the things finished processing after all the requests are submitted, otherwise you don't even know what happened to them.
We send the request with data and as one of the parameters we give a callback class. The request returns almost immediately and when it succeeds or fails the callback is called.
Makes sense now. So you can use the same pattern with countdown latch. Just check the resUlt to make sure no errors occurred. When count down latch goes to 0 and you don't have no errors that means all your documents are indexed on primary and all currently available replicas.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.