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

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


//        new AliasAction(AliasAction.Type.ADD, index, alias)
        client.admin().indices().aliases(new IndicesAliasesRequest().addAlias(indexName, alias)).actionGet();
    }

    public void nodeInfo() {
        NodesInfoResponse rsp = client.admin().cluster().nodesInfo(new NodesInfoRequest()).actionGet();
        String str = "Cluster:" + rsp.getClusterName() + ". Active nodes:";
        str += rsp.getNodesMap().keySet();
        logger.info(str);
    }
View Full Code Here


        node.client().admin().cluster().health(new ClusterHealthRequest("twindex").waitForActiveShards(1)).actionGet();
        logger.info("Now node has at least one active shard!");
    }

    public void printInfo() {
        NodesInfoResponse rsp = node.client().admin().cluster().nodesInfo(new NodesInfoRequest()).actionGet();
        String str = "Cluster:" + rsp.getClusterName() + ". Active nodes:";
        str += rsp.getNodesMap().keySet();
        logger.info(str);
    }
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());
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());
View Full Code Here

            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

   * 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());
View Full Code Here

     *
     * @return The nodes info request
     * @see org.elasticsearch.client.ClusterAdminClient#nodesInfo(org.elasticsearch.action.admin.cluster.node.info.NodesInfoRequest)
     */
    public static NodesInfoRequest nodesInfoRequest() {
        return new NodesInfoRequest();
    }
View Full Code Here

     * @param nodesIds The nodes ids to get the status for
     * @return The nodes info request
     * @see org.elasticsearch.client.ClusterAdminClient#nodesStats(org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequest)
     */
    public static NodesInfoRequest nodesInfoRequest(String... nodesIds) {
        return new NodesInfoRequest(nodesIds);
    }
View Full Code Here

        clusterStateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterStateRequest.masterNodeTimeout()));

        client.admin().cluster().state(clusterStateRequest, new RestActionListener<ClusterStateResponse>(channel) {
            @Override
            public void processResponse(final ClusterStateResponse clusterStateResponse) {
                NodesInfoRequest nodesInfoRequest = new NodesInfoRequest();
                nodesInfoRequest.clear().process(true).threadPool(true);
                client.admin().cluster().nodesInfo(nodesInfoRequest, new RestActionListener<NodesInfoResponse>(channel) {
                    @Override
                    public void processResponse(final NodesInfoResponse nodesInfoResponse) {
                        NodesStatsRequest nodesStatsRequest = new NodesStatsRequest();
                        nodesStatsRequest.clear().threadPool(true);
View Full Code Here

TOP

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

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.