Package org.elasticsearch.action.admin.cluster.node.stats

Examples of org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequestBuilder


    }
    return builder.build();
  }

  public Map<String, NodeHealth > getNodesHealth() {
    NodesStatsRequestBuilder nodesStatsRequest = searchClient.prepareNodesStats().all();
    NodesStatsResponse nodesStats = nodesStatsRequest.get();

    Map<String, NodeHealth> health = Maps.newHashMap();
    for (Entry<String, NodeStats> nodeEntry: nodesStats.getNodesMap().entrySet()) {
      health.put(nodeEntry.getKey(), new NodeHealth(nodeEntry.getValue()));
    }
View Full Code Here


        execute(NodesStatsAction.INSTANCE, request, listener);
    }

    @Override
    public NodesStatsRequestBuilder prepareNodesStats(String... nodesIds) {
        return new NodesStatsRequestBuilder(this).setNodesIds(nodesIds);
    }
View Full Code Here

        for (NodeInfo n : nodesInfo.getNodes()) {
            TransportClient tc = new TransportClient(settings).addTransportAddress(n.getNode().address());

            // randomize the combination of flags set
            // Uses reflection to find methods in an attempt to future-proof this test against newly added flags
            NodesStatsRequestBuilder nsBuilder = tc.admin().cluster().prepareNodesStats();

            Class c = nsBuilder.getClass();
            for (Method method : c.getDeclaredMethods()) {
                if (method.getName().startsWith("set")) {
                    if (method.getParameterTypes().length == 1 && method.getParameterTypes()[0] == boolean.class) {
                        method.invoke(nsBuilder, randomBoolean());
                    }
                } else if ((method.getName().equals("all") || method.getName().equals("clear")) && randomBoolean()) {
                    method.invoke(nsBuilder);
                }
            }
            NodesStatsResponse ns = nsBuilder.execute().actionGet();
            tc.close();

        }
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequestBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.