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

Examples of org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse


    private final AsyncHttpClient httpClient = new AsyncHttpClient();
    private int port;

    @Before
    public void setPort() {
        NodesInfoResponse response = client().admin().cluster().prepareNodesInfo().setHttp(true).execute().actionGet();
        port = ((InetSocketTransportAddress) response.getNodes()[0].getHttp().address().boundAddress()).address().getPort();
    }
View Full Code Here


        node.close();
    }

    @Test
    public void assertPluginLoaded() {
        NodesInfoResponse nodesInfoResponse = client.admin().cluster().prepareNodesInfo().setPlugins(true).get();
        assertEquals(nodesInfoResponse.getNodes().length, 1);
        assertNotNull(nodesInfoResponse.getNodes()[0].getPlugins().getInfos());
        assertEquals(nodesInfoResponse.getNodes()[0].getPlugins().getInfos().size(), 1);
        assertEquals(nodesInfoResponse.getNodes()[0].getPlugins().getInfos().get(0).isSite(), false);
        assertTrue(nodesInfoResponse.getNodes()[0].getPlugins().getInfos().get(0).getName().startsWith("index-termlist"));
    }
View Full Code Here

   * Returns information about a cluster.
   * @return a map of key value pairs containing cluster information
   */
  public static Map<String, String> getSearchClusterMetadata() {
    Map<String, String> md = new HashMap<String, String>();
    NodesInfoResponse res = getClient().admin().cluster().nodesInfo(new NodesInfoRequest().all()).actionGet();
    md.put("cluser.name", res.getClusterName().toString());

    for (NodeInfo nodeInfo : res) {
      md.put("node.name", nodeInfo.getNode().getName());
      md.put("node.name", nodeInfo.getNode().getAddress().toString());
      md.put("node.data", Boolean.toString(nodeInfo.getNode().isDataNode()));
View Full Code Here

                .settings(settingsBuilder().loadFromClasspath("META-INF/elasticsearch/elasticsearch-embedded.yml"))
                .node();

        // Looking for nodes configuration
        if (log.isInfoEnabled()) {
            final NodesInfoResponse nir =
                    client().admin().cluster().prepareNodesInfo().execute().actionGet();

            log.info("Elasticsearch client is now connected to the " + nir.nodes().length + " node(s) cluster named \""
                    + nir.clusterName() + "\"");
        }
    }
View Full Code Here

        for (String nodeAddress : nodesAddresses) {
            client.addTransportAddress(parseAddress(nodeAddress));
        }

        if (log.isInfoEnabled()) {
            NodesInfoResponse nir =
                    client.admin().cluster().nodesInfo(new NodesInfoRequest()).actionGet();

            log.info("Elasticsearch client is now connected to the " + nir.nodes().length + " node(s) cluster named \""
                    + nir.clusterName() + "\"");
        }
    }
View Full Code Here

  protected String clusterName() {
    return CLUSTER_NAME;
  }

  protected String nodeAddress() {
    NodesInfoResponse nodesInfo = client().admin().cluster().nodesInfo(new NodesInfoRequest()).actionGet();
    String transportAddress = nodesInfo.getNodes()[0].getNode().address().toString();
    Matcher matcher = Pattern.compile("\\d{1,3}(?:\\.\\d{1,3}){3}(?::\\d{1,5})?").matcher(transportAddress);
    matcher.find();
    return matcher.group();
  }
View Full Code Here

    public NodeInfo[] getNodeInfo(String clusterName) {
        Set<Node> nodeSet = nodesClusterMap.get(clusterName);
        if (nodeSet != null) {
            for (Node node : nodeSet) {
                ClusterAdminClient client = node.client().admin().cluster();
                NodesInfoResponse response = client.prepareNodesInfo().all().execute().actionGet();
                return response.getNodes();
            }
        }
        return null;
    }
View Full Code Here

   * Returns information about a cluster.
   * @return a map of key value pairs containing cluster information
   */
  public static Map<String, String> getSearchClusterMetadata() {
    Map<String, String> md = new HashMap<String, String>();
    NodesInfoResponse res = getClient().admin().cluster().nodesInfo(new NodesInfoRequest().all()).actionGet();
    md.put("cluser.name", res.getClusterName().toString());

    for (NodeInfo nodeInfo : res) {
      md.put("node.name", nodeInfo.getNode().getName());
      md.put("node.address", nodeInfo.getNode().getAddress().toString());
      md.put("node.data", Boolean.toString(nodeInfo.getNode().isDataNode()));
View Full Code Here

   @Test
  public void test_multiple_nodes() {
    Client client = checkClient("testNodeClient");
    assertThat(client, instanceOf(org.elasticsearch.client.transport.TransportClient.class));

        NodesInfoResponse nodeInfos = client.admin().cluster().prepareNodesInfo().get();
        assertThat(nodeInfos.getNodes().length, is(2));
  }
View Full Code Here

            }
        }
    }

    private long getBulkQueueSize() {
        NodesInfoResponse response = client.admin().cluster().prepareNodesInfo().setThreadPool(true).get();
        for (NodeInfo node : response.getNodes()) {
            Iterator<Info> iterator = node.getThreadPool().iterator();
            while (iterator.hasNext()) {
                Info info = iterator.next();
                if ("bulk".equals(info.getName())) {
                    return info.getQueueSize().getSingles();
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse

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.