Package org.elasticsearch.common.transport

Examples of org.elasticsearch.common.transport.InetSocketTransportAddress


        port        = ConfigurationManager.getIntProperty("elastic-search-statistics", "port", port);

        log.info("Creating TransportClient to [Address:" + address + "] [Port:" + port + "] [cluster.name:" + clusterName + "]");

        Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", clusterName).build();
        client = new TransportClient(settings).addTransportAddress(new InetSocketTransportAddress(address, port));
    }
View Full Code Here


    String[] parts = new String[2];
    for (String host : _hosts) {
      if (StringUtils.split(host, ":", parts) == 1) {
        parts[1] = "9300";
      }
      client.addTransportAddress(new InetSocketTransportAddress(parts[0], Integer.parseInt(parts[1])));
    }

    return new TransportClient(_clusterName, client);
  }
View Full Code Here

      String hostName = substringBefore(clusterNode, COLON);
      String port = substringAfter(clusterNode, COLON);
      Assert.hasText(hostName, "[Assertion failed] missing host name in 'clusterNodes'");
      Assert.hasText(port, "[Assertion failed] missing port in 'clusterNodes'");
      logger.info("adding transport node : " + clusterNode);
      client.addTransportAddress(new InetSocketTransportAddress(hostName, Integer.valueOf(port)));
    }
    client.connectedNodes();
  }
View Full Code Here

      .put("network.bind_host", "localhost")
      .put("node.rack_id", StringUtils.defaultIfEmpty(settings.getString(ProcessConstants.CLUSTER_NODE_NAME), "unknown"))
      .put("cluster.name", StringUtils.defaultIfBlank(settings.getString(ProcessConstants.CLUSTER_NAME), "sonarqube"))
      .build());
    initLogging();
    this.addTransportAddress(new InetSocketTransportAddress(LoopbackAddress.get().getHostAddress(),
      settings.getInt(ProcessConstants.SEARCH_PORT)));
    this.profiling = profiling;
  }
View Full Code Here

  private Client getSearchClient() {
    Settings settings = ImmutableSettings.settingsBuilder()
      .put("cluster.name", CLUSTER_NAME).build();
    Client client = new TransportClient(settings)
      .addTransportAddress(new InetSocketTransportAddress("localhost", port));
    assertThat(client.admin().cluster().prepareClusterStats().get().getStatus()).isEqualTo(ClusterHealthStatus.GREEN);
    return client;
  }
View Full Code Here

    Settings settings = ImmutableSettings.settingsBuilder()
        .put("cluster.name", clusterName)
        .build();
    TransportClient tclient = new TransportClient(settings);
    for (String node : esNodes) {
      tclient.addTransportAddress(new InetSocketTransportAddress(node, transportPort));
    }
    return tclient;
  }
View Full Code Here

        createIndex(Config.APP_NAME_NS);
      }
    } else {
      searchClient = new TransportClient();
        ((TransportClient) searchClient).addTransportAddress(
            new InetSocketTransportAddress("localhost", 9300));
    }

    Para.addDestroyListener(new Para.DestroyListener() {
      public void onDestroy() {
        shutdownClient();
View Full Code Here

    }

    private InetSocketTransportAddress parseAddress(String address) {
        String[] addressItems = address.split(":", 2);
        int port = Integer.parseInt(addressItems.length > 1 ? addressItems[1] : env.getRequiredProperty("elasticsearch.cluster.default.communication.port"));
        return new InetSocketTransportAddress(addressItems[0], port);
    }
View Full Code Here

    // Add specified TransportAddresses
    for (String host : hosts.split(",")) {
      String[] params = host.split(":");
      String hostname = params[0];
      int port = (params.length == 2) ? Integer.valueOf(params[1]) : 9300;
      transportClient.addTransportAddress(new InetSocketTransportAddress(hostname, port));
    }
    return transportClient;
  }
View Full Code Here

            try {
                publishAddress = new InetSocketAddress(networkService.resolvePublishHostAddress(publishHost), jettyBoundAddress.getPort());
            } catch (Exception e) {
                throw new BindTransportException("Failed to resolve publish address", e);
            }
            this.boundAddress = new BoundTransportAddress(new InetSocketTransportAddress(jettyBoundAddress), new InetSocketTransportAddress(publishAddress));
        } else {
            throw new BindHttpException("Failed to find a jetty connector with Inet transport");
        }
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.common.transport.InetSocketTransportAddress

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.