Package org.elasticsearch.client.transport

Examples of org.elasticsearch.client.transport.TransportClient


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

    Para.addDestroyListener(new Para.DestroyListener() {
View Full Code Here


    private TransportClient transportClient;

    private TransportClient getTransportClient() {
        if (transportClient == null) {
            transportClient = new TransportClient(settingsBuilder()
                    .put("cluster.name", internalCluster().getClusterName())
                    .put("name", "programmatic_transport_client")
                    .put("client.transport.nodes_sampler_interval", "1s")
                    .build());
            Transport transport = internalCluster().getDataNodeInstance(Transport.class);
View Full Code Here

  public synchronized void start() {
    if (client != null) {
      logger.info("Client started already, ignoring start() call");
      return;
    }
    TransportClient tclient = new TransportClient(ImmutableSettings.settingsBuilder().put(settingsConf).build());
    tclient.addTransportAddresses(transportAddresses);
    client = tclient;
  }
View Full Code Here

        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

      throw new NullPointerException("transportClientSettings");
    }
    if (index == null) {
      throw new NullPointerException("index");
    }
    _client = new TransportClient(transportClientSettings);
    _index = index;
  }
View Full Code Here

  public void afterPropertiesSet() throws Exception {
    buildClient();
  }

  protected void buildClient() throws Exception {
    client = new TransportClient(settings());
    Assert.hasText(clusterNodes, "[Assertion failed] clusterNodes settings missing.");
    for (String clusterNode : split(clusterNodes, COMMA)) {
      String hostName = substringBefore(clusterNode, COLON);
      String port = substringAfter(clusterNode, COLON);
      Assert.hasText(hostName, "[Assertion failed] missing host name in 'clusterNodes'");
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

  private Client constructClient() {
    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

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

    Para.addDestroyListener(new Para.DestroyListener() {
View Full Code Here

        log.info("Initializing Elasticsearch remote client...");

        Settings settings = ImmutableSettings.settingsBuilder()
                .put("cluster.name", env.getRequiredProperty("elasticsearch.cluster.name"))
                .build();
        client = new TransportClient(settings, false);

        // Looking for nodes configuration
        String nodes = env.getRequiredProperty("elasticsearch.cluster.nodes");
        String[] nodesAddresses = nodes.split(",");
        if (nodesAddresses.length == 0) {
View Full Code Here

TOP

Related Classes of org.elasticsearch.client.transport.TransportClient

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.