Ivan,
I understand, but have you looked at
org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest/Response?
You can obtain fine grained control over everything - waiting for nodes,
shards, if they relocate, initialize. In ClusterHealthResponse, ES will
provide you everything about the current health state. There are several
methods in ClusterHealthResponse
activeShards(), relocatingShards(), activePrimaryShards(),
initializingShards(), unassignedShards(), numberOfNodes(),
numberOfDataNodes()
that allow you to enter a loop to wait for the exact state of the
cluster your application requires, or an exact state to let your
application abort.
Note, "yellow" and "green" are just useful traffic light mnemonics for
the reliability level of the cluster - I won't call them kludgy. They
are of great assistance so nobody needs to write programs that poll the
cluster over and over again just to count nodes or shards for computing
the current cluster reliability (and maybe doing it wrong).
In my use case, I enable refresh and add a replica level after bulk
indexing, and I don't wait for cluster health before search continues.
And yes, it works smoothly. I wait for green only before bulk indexing
starts, not afterwards, when it completes.
Best regards,
Jörg
Am 04.02.13 19:35, schrieb Ivan Brusic:
Jörg, the issue is not bulk indexing, but afterwards.
After bulk indexing, I want to wait for the cluster to return to green
before executing some administrative tasks such as moving aliases.
Increasing the replica count does not send the cluster to a yellow
state immediately, so waiting for green is not possible since the
green will be green momentarily.
The current solution is too wait for yellow and then to wait for
green. Anything suggestions for something less kludgy?
--
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.
For more options, visit https://groups.google.com/groups/opt_out.