@Override public PendingClusterTasksResponse newResponse() { return new PendingClusterTasksResponse(); }
/** * The pending cluster tasks */ public List<PendingClusterTask> getPendingTasks() { return pendingTasks(); }
public String pendingClusterTasks() { PendingClusterTasksResponse r = this.elasticsearchClient.admin().cluster().preparePendingClusterTasks().get(); return r.prettyPrint(); }
public String pendingClusterTasks() { PendingClusterTasksResponse r = this.elasticsearchClient.admin().cluster().preparePendingClusterTasks().get(); return r.toString(); }
@Override public String toString() { try { XContentBuilder builder = XContentFactory.jsonBuilder().prettyPrint(); builder.startObject(); toXContent(builder, EMPTY_PARAMS); builder.endObject(); return builder.string(); } catch (IOException e) { return "{ \"error\" : \"" + e.getMessage() + "\"}"; } }
@Override protected PendingClusterTasksResponse newResponse() { return new PendingClusterTasksResponse(); }
/** * The pending cluster tasks */ public List<PendingClusterTask> getPendingTasks() { return pendingTasks(); }
/** * Ensures the cluster has a green state via the cluster health API. This method will also wait for relocations. * It is useful to ensure that all action on the cluster have finished and all shards that were currently relocating * are now allocated and started. */ public ClusterHealthStatus ensureGreen(Client client, String... indices) { ClusterHealthResponse actionGet = client.admin().cluster() .health(Requests.clusterHealthRequest(indices).waitForGreenStatus().waitForEvents(Priority.LANGUID).waitForRelocatingShards(0)).actionGet(); if (actionGet.isTimedOut()) { logger.info("ensureGreen timed out, cluster state:\n{}\n{}", client.admin().cluster().prepareState().get().getState().prettyPrint(), client.admin().cluster().preparePendingClusterTasks().get().prettyPrint()); assertThat("timed out waiting for green state", actionGet.isTimedOut(), equalTo(false)); } assertThat(actionGet.getStatus(), equalTo(ClusterHealthStatus.GREEN)); return actionGet.getStatus(); }
@Override protected void masterOperation(PendingClusterTasksRequest request, ClusterState state, ActionListener<PendingClusterTasksResponse> listener) { logger.trace("fetching pending tasks from cluster service"); final List<PendingClusterTask> pendingTasks = clusterService.getMasterService().pendingTasks(); logger.trace("done fetching pending tasks from cluster service"); listener.onResponse(new PendingClusterTasksResponse(pendingTasks)); } }
/** * The pending cluster tasks */ public List<PendingClusterTask> getPendingTasks() { return pendingTasks(); }
@Override protected PendingClusterTasksResponse newResponse() { return new PendingClusterTasksResponse(); }
/** * The pending cluster tasks */ public List<PendingClusterTask> getPendingTasks() { return pendingTasks(); }
@Override public PendingClusterTasksResponse newResponse() { return new PendingClusterTasksResponse(); }
/** * The pending cluster tasks */ public List<PendingClusterTask> getPendingTasks() { return pendingTasks(); }
@Override protected PendingClusterTasksResponse newResponse() { return new PendingClusterTasksResponse(); }
@Override public PendingClusterTasksResponse newResponse() { return new PendingClusterTasksResponse(); }
@Override public PendingClusterTasksResponse newResponse() { return new PendingClusterTasksResponse(); }
@Override protected PendingClusterTasksResponse newResponse() { return new PendingClusterTasksResponse(); }
@Override public PendingClusterTasksResponse newResponse() { return new PendingClusterTasksResponse(); }
@Override protected PendingClusterTasksResponse newResponse() { return new PendingClusterTasksResponse(); }