/** * Sets the number of shard copies that must be active across all indices before getting the * health status. Defaults to {@link ActiveShardCount#NONE}, meaning we don't wait on any active shards. * Set this value to {@link ActiveShardCount#ALL} to wait for all shards (primary and * all replicas) to be active across all indices in the cluster. Otherwise, use * {@link ActiveShardCount#from(int)} to set this value to any non-negative integer, up to the * total number of shard copies to wait for. */ public ClusterHealthRequest waitForActiveShards(ActiveShardCount waitForActiveShards) { if (waitForActiveShards.equals(ActiveShardCount.DEFAULT)) { // the default for cluster health request is 0, not 1 this.waitForActiveShards = ActiveShardCount.NONE; } else { this.waitForActiveShards = waitForActiveShards; } return this; }
/** * Sets the number of shard copies that must be active before getting the health status. * Defaults to {@link ActiveShardCount#NONE}, meaning we don't wait on any active shards. * Set this value to {@link ActiveShardCount#ALL} to wait for all shards (primary and * all replicas) to be active across all indices in the cluster. Otherwise, use * {@link ActiveShardCount#from(int)} to set this value to any non-negative integer, up to the * total number of shard copies that would exist across all indices in the cluster. */ public ClusterHealthRequestBuilder setWaitForActiveShards(ActiveShardCount waitForActiveShards) { if (waitForActiveShards.equals(ActiveShardCount.DEFAULT)) { // the default for cluster health is 0, not 1 request.waitForActiveShards(ActiveShardCount.NONE); } else { request.waitForActiveShards(waitForActiveShards); } return this; }
waitForCounter++; if (request.waitForActiveShards().equals(ActiveShardCount.NONE) == false) { ActiveShardCount waitForActiveShards = request.waitForActiveShards(); assert waitForActiveShards.equals(ActiveShardCount.DEFAULT) == false : "waitForActiveShards must not be DEFAULT on the request object, instead it should be NONE"; if (waitForActiveShards.equals(ActiveShardCount.ALL)) { if (response.getUnassignedShards() == 0 && response.getInitializingShards() == 0) {
/** * Sets the number of shard copies that must be active across all indices before getting the * health status. Defaults to {@link ActiveShardCount#NONE}, meaning we don't wait on any active shards. * Set this value to {@link ActiveShardCount#ALL} to wait for all shards (primary and * all replicas) to be active across all indices in the cluster. Otherwise, use * {@link ActiveShardCount#from(int)} to set this value to any non-negative integer, up to the * total number of shard copies to wait for. */ public ClusterHealthRequest waitForActiveShards(ActiveShardCount waitForActiveShards) { if (waitForActiveShards.equals(ActiveShardCount.DEFAULT)) { // the default for cluster health request is 0, not 1 this.waitForActiveShards = ActiveShardCount.NONE; } else { this.waitForActiveShards = waitForActiveShards; } return this; }
/** * Sets the number of shard copies that must be active across all indices before getting the * health status. Defaults to {@link ActiveShardCount#NONE}, meaning we don't wait on any active shards. * Set this value to {@link ActiveShardCount#ALL} to wait for all shards (primary and * all replicas) to be active across all indices in the cluster. Otherwise, use * {@link ActiveShardCount#from(int)} to set this value to any non-negative integer, up to the * total number of shard copies to wait for. */ public ClusterHealthRequest waitForActiveShards(ActiveShardCount waitForActiveShards) { if (waitForActiveShards.equals(ActiveShardCount.DEFAULT)) { // the default for cluster health request is 0, not 1 this.waitForActiveShards = ActiveShardCount.NONE; } else { this.waitForActiveShards = waitForActiveShards; } return this; }
/** * Sets the number of shard copies that must be active across all indices before getting the * health status. Defaults to {@link ActiveShardCount#NONE}, meaning we don't wait on any active shards. * Set this value to {@link ActiveShardCount#ALL} to wait for all shards (primary and * all replicas) to be active across all indices in the cluster. Otherwise, use * {@link ActiveShardCount#from(int)} to set this value to any non-negative integer, up to the * total number of shard copies to wait for. */ public ClusterHealthRequest waitForActiveShards(ActiveShardCount waitForActiveShards) { if (waitForActiveShards.equals(ActiveShardCount.DEFAULT)) { // the default for cluster health request is 0, not 1 this.waitForActiveShards = ActiveShardCount.NONE; } else { this.waitForActiveShards = waitForActiveShards; } return this; }
waitFor++; if (request.waitForActiveShards().equals(ActiveShardCount.NONE) == false) { waitFor++;
/** * Sets the number of shard copies that must be active before getting the health status. * Defaults to {@link ActiveShardCount#NONE}, meaning we don't wait on any active shards. * Set this value to {@link ActiveShardCount#ALL} to wait for all shards (primary and * all replicas) to be active across all indices in the cluster. Otherwise, use * {@link ActiveShardCount#from(int)} to set this value to any non-negative integer, up to the * total number of shard copies that would exist across all indices in the cluster. */ public ClusterHealthRequestBuilder setWaitForActiveShards(ActiveShardCount waitForActiveShards) { if (waitForActiveShards.equals(ActiveShardCount.DEFAULT)) { // the default for cluster health is 0, not 1 request.waitForActiveShards(ActiveShardCount.NONE); } else { request.waitForActiveShards(waitForActiveShards); } return this; }
/** * Sets the number of shard copies that must be active before getting the health status. * Defaults to {@link ActiveShardCount#NONE}, meaning we don't wait on any active shards. * Set this value to {@link ActiveShardCount#ALL} to wait for all shards (primary and * all replicas) to be active across all indices in the cluster. Otherwise, use * {@link ActiveShardCount#from(int)} to set this value to any non-negative integer, up to the * total number of shard copies that would exist across all indices in the cluster. */ public ClusterHealthRequestBuilder setWaitForActiveShards(ActiveShardCount waitForActiveShards) { if (waitForActiveShards.equals(ActiveShardCount.DEFAULT)) { // the default for cluster health is 0, not 1 request.waitForActiveShards(ActiveShardCount.NONE); } else { request.waitForActiveShards(waitForActiveShards); } return this; }
/** * Sets the number of shard copies that must be active before getting the health status. * Defaults to {@link ActiveShardCount#NONE}, meaning we don't wait on any active shards. * Set this value to {@link ActiveShardCount#ALL} to wait for all shards (primary and * all replicas) to be active across all indices in the cluster. Otherwise, use * {@link ActiveShardCount#from(int)} to set this value to any non-negative integer, up to the * total number of shard copies that would exist across all indices in the cluster. */ public ClusterHealthRequestBuilder setWaitForActiveShards(ActiveShardCount waitForActiveShards) { if (waitForActiveShards.equals(ActiveShardCount.DEFAULT)) { // the default for cluster health is 0, not 1 request.waitForActiveShards(ActiveShardCount.NONE); } else { request.waitForActiveShards(waitForActiveShards); } return this; }
waitForCounter++; if (request.waitForActiveShards().equals(ActiveShardCount.NONE) == false) { ActiveShardCount waitForActiveShards = request.waitForActiveShards(); assert waitForActiveShards.equals(ActiveShardCount.DEFAULT) == false : "waitForActiveShards must not be DEFAULT on the request object, instead it should be NONE"; if (waitForActiveShards.equals(ActiveShardCount.ALL) && response.getUnassignedShards() == 0 && response.getInitializingShards() == 0) {
waitForCounter++; if (request.waitForActiveShards().equals(ActiveShardCount.NONE) == false) { ActiveShardCount waitForActiveShards = request.waitForActiveShards(); assert waitForActiveShards.equals(ActiveShardCount.DEFAULT) == false : "waitForActiveShards must not be DEFAULT on the request object, instead it should be NONE"; if (waitForActiveShards.equals(ActiveShardCount.ALL)) { if (response.getUnassignedShards() == 0 && response.getInitializingShards() == 0) {
waitForCounter++; if (request.waitForActiveShards().equals(ActiveShardCount.NONE) == false) { ActiveShardCount waitForActiveShards = request.waitForActiveShards(); assert waitForActiveShards.equals(ActiveShardCount.DEFAULT) == false : "waitForActiveShards must not be DEFAULT on the request object, instead it should be NONE"; if (waitForActiveShards.equals(ActiveShardCount.ALL)) { if (response.getUnassignedShards() == 0 && response.getInitializingShards() == 0) {
waitFor++; if (request.waitForActiveShards().equals(ActiveShardCount.NONE) == false) { waitFor++;
waitFor--; if (request.waitForActiveShards().equals(ActiveShardCount.NONE)) { waitFor--;
waitFor++; if (request.waitForActiveShards().equals(ActiveShardCount.NONE) == false) { waitFor++;