NodesStatsResponse nir = tc.admin().cluster().nodesStats(new NodesStatsRequest()).actionGet(); sb.append(Strings.toString(nir,true, true)); } catch (Exception e1) {
/** * Retrieve the latest nodes stats, calling the listener when complete * @return a latch that can be used to wait for the nodes stats to complete if desired */ protected CountDownLatch updateNodeStats(final ActionListener<NodesStatsResponse> listener) { final CountDownLatch latch = new CountDownLatch(1); final NodesStatsRequest nodesStatsRequest = new NodesStatsRequest("data:true"); nodesStatsRequest.clear(); nodesStatsRequest.fs(true); nodesStatsRequest.timeout(fetchTimeout); client.admin().cluster().nodesStats(nodesStatsRequest, new LatchedActionListener<>(listener, latch)); return latch; }
@Override protected RestChannelConsumer doCatRequest(final RestRequest request, final NodeClient client) { final NodesStatsRequest nodesStatsRequest = new NodesStatsRequest("data:true"); nodesStatsRequest.clear(); nodesStatsRequest.indices(true); String[] fields = request.paramAsStringArray("fields", null); nodesStatsRequest.indices().fieldDataFields(fields == null ? new String[] {"*"} : fields); return channel -> client.admin().cluster().nodesStats(nodesStatsRequest, new RestResponseListener<NodesStatsResponse>(channel) { @Override public RestResponse buildResponse(NodesStatsResponse nodeStatses) throws Exception { return RestTable.buildResponse(buildTable(request, nodeStatses), channel); } }); }
return channel -> client.admin().cluster().nodesStats(nodesStatsRequest, new NodesResponseRestListener<>(channel));
@Override protected ActionFuture<NodesStatsResponse> doExecute(NodesStatsRequest request) { return client.admin().cluster().nodesStats(request); }
private Map<String, NodeStats> fetchNodeStats() { ClusterAdminClient adminClient = this.client.admin().cluster(); NodesStatsResponse nodesStatsResponse = adminClient.nodesStats(adminClient.prepareNodesStats().request()).actionGet(); return nodesStatsResponse.getNodesMap(); } }
@Override public void processResponse(final ClusterStateResponse state) { NodesStatsRequest statsRequest = new NodesStatsRequest(nodes); statsRequest.clear().fs(true).indices(new CommonStatsFlags(CommonStatsFlags.Flag.Store)); client.admin().cluster().nodesStats(statsRequest, new RestResponseListener<NodesStatsResponse>(channel) { @Override public RestResponse buildResponse(NodesStatsResponse stats) throws Exception { Table tab = buildTable(request, state, stats); return RestTable.buildResponse(tab, channel); } }); } });
NodesStatsResponse nir = tc.admin().cluster().nodesStats(new NodesStatsRequest()).actionGet(); sb.append(Strings.toString(nir,true, true)); } catch (Exception e1) {
/** * Retrieve the latest nodes stats, calling the listener when complete * @return a latch that can be used to wait for the nodes stats to complete if desired */ protected CountDownLatch updateNodeStats(final ActionListener<NodesStatsResponse> listener) { final CountDownLatch latch = new CountDownLatch(1); final NodesStatsRequest nodesStatsRequest = new NodesStatsRequest("data:true"); nodesStatsRequest.clear(); nodesStatsRequest.fs(true); nodesStatsRequest.timeout(fetchTimeout); client.admin().cluster().nodesStats(nodesStatsRequest, new LatchedActionListener<>(listener, latch)); return latch; }
/** * Retrieve the latest nodes stats, calling the listener when complete * @return a latch that can be used to wait for the nodes stats to complete if desired */ protected CountDownLatch updateNodeStats(final ActionListener<NodesStatsResponse> listener) { final CountDownLatch latch = new CountDownLatch(1); final NodesStatsRequest nodesStatsRequest = new NodesStatsRequest("data:true"); nodesStatsRequest.clear(); nodesStatsRequest.fs(true); nodesStatsRequest.timeout(fetchTimeout); client.admin().cluster().nodesStats(nodesStatsRequest, new LatchedActionListener<>(listener, latch)); return latch; }
/** * Retrieve the latest nodes stats, calling the listener when complete * @return a latch that can be used to wait for the nodes stats to complete if desired */ protected CountDownLatch updateNodeStats(final ActionListener<NodesStatsResponse> listener) { final CountDownLatch latch = new CountDownLatch(1); final NodesStatsRequest nodesStatsRequest = new NodesStatsRequest("data:true"); nodesStatsRequest.clear(); nodesStatsRequest.fs(true); nodesStatsRequest.timeout(fetchTimeout); client.admin().cluster().nodesStats(nodesStatsRequest, new LatchedActionListener<>(listener, latch)); return latch; }
@Override protected void doRequest(final RestRequest request, final RestChannel channel, final Client client) { final NodesStatsRequest nodesStatsRequest = new NodesStatsRequest("data:true"); nodesStatsRequest.clear(); nodesStatsRequest.indices(true); String[] fields = request.paramAsStringArray("fields", null); nodesStatsRequest.indices().fieldDataFields(fields == null ? new String[] {"*"} : fields); client.admin().cluster().nodesStats(nodesStatsRequest, new RestResponseListener<NodesStatsResponse>(channel) { @Override public RestResponse buildResponse(NodesStatsResponse nodeStatses) throws Exception { return RestTable.buildResponse(buildTable(request, nodeStatses), channel); } }); }
@Override protected RestChannelConsumer doCatRequest(final RestRequest request, final NodeClient client) { final NodesStatsRequest nodesStatsRequest = new NodesStatsRequest("data:true"); nodesStatsRequest.clear(); nodesStatsRequest.indices(true); String[] fields = request.paramAsStringArray("fields", null); nodesStatsRequest.indices().fieldDataFields(fields == null ? new String[] {"*"} : fields); return channel -> client.admin().cluster().nodesStats(nodesStatsRequest, new RestResponseListener<NodesStatsResponse>(channel) { @Override public RestResponse buildResponse(NodesStatsResponse nodeStatses) throws Exception { return RestTable.buildResponse(buildTable(request, nodeStatses), channel); } }); }
@Override protected RestChannelConsumer doCatRequest(final RestRequest request, final NodeClient client) { final NodesStatsRequest nodesStatsRequest = new NodesStatsRequest("data:true"); nodesStatsRequest.clear(); nodesStatsRequest.indices(true); String[] fields = request.paramAsStringArray("fields", null); nodesStatsRequest.indices().fieldDataFields(fields == null ? new String[] {"*"} : fields); return channel -> client.admin().cluster().nodesStats(nodesStatsRequest, new RestResponseListener<NodesStatsResponse>(channel) { @Override public RestResponse buildResponse(NodesStatsResponse nodeStatses) throws Exception { return RestTable.buildResponse(buildTable(request, nodeStatses), channel); } }); }
@Override protected RestChannelConsumer doCatRequest(final RestRequest request, final NodeClient client) { final NodesStatsRequest nodesStatsRequest = new NodesStatsRequest("data:true"); nodesStatsRequest.clear(); nodesStatsRequest.indices(true); String[] fields = request.paramAsStringArray("fields", null); nodesStatsRequest.indices().fieldDataFields(fields == null ? new String[] {"*"} : fields); return channel -> client.admin().cluster().nodesStats(nodesStatsRequest, new RestResponseListener<NodesStatsResponse>(channel) { @Override public RestResponse buildResponse(NodesStatsResponse nodeStatses) throws Exception { return RestTable.buildResponse(buildTable(request, nodeStatses), channel); } }); }
return channel -> client.admin().cluster().nodesStats(nodesStatsRequest, new NodesResponseRestListener<>(channel));
return channel -> client.admin().cluster().nodesStats(nodesStatsRequest, new NodesResponseRestListener<>(channel));
return channel -> client.admin().cluster().nodesStats(nodesStatsRequest, new NodesResponseRestListener<>(channel));
client.admin().cluster().nodesStats(nodesStatsRequest, new RestToXContentListener<NodesStatsResponse>(channel));