Package org.elasticsearch.common.transport

Examples of org.elasticsearch.common.transport.InetSocketTransportAddress


            logger.warn("Exception caught on netty layer [" + ctx.getChannel() + "]", e.getCause());
        }
    }

    TransportAddress wrapAddress(SocketAddress socketAddress) {
        return new InetSocketTransportAddress((InetSocketAddress) socketAddress);
    }
View Full Code Here


    // Set the cluster name and build the settings
    Settings settings = settingsBuilder.put("cluster.name", clusterName).build();
   
    // Prefer TransportClient
    if (host != null && port > 1) {
      client = new TransportClient(settings).addTransportAddress(new InetSocketTransportAddress(host, port));
    } else if (clusterName != null) {
      node = nodeBuilder().settings(settings).client(true).node();
      client = node.client();
    }
View Full Code Here

      searchNode = NodeBuilder.nodeBuilder().settings(settings).local(true).data(true).node();
      searchClient = searchNode.client();
    } else {
      searchClient = new TransportClient();
        ((TransportClient) searchClient).addTransportAddress(
            new InetSocketTransportAddress("localhost", 9300));
    }

    if (!existsIndex(Config.APP_NAME_NS)) {
      createIndex(Config.APP_NAME_NS);
    }
View Full Code Here

                String[] split = address.split(":");

                String hostname = split[0];
                int port = (split.length == 1 ? 9300 : Integer.getInteger(split[1]));

                transportAddresses.add(new InetSocketTransportAddress(hostname, port));
            }
        }

        // Recall super method to get any additional addresses
        super.initTransportAddresses(config);
View Full Code Here

      for (int i = 0; i < hostNames.length; i++) {
        String[] hostPort = hostNames[i].split(":");
        String host = hostPort[0];
        int port = hostPort.length == 2 ? Integer.parseInt(hostPort[1])
            : DEFAULT_PORT;
        serverAddresses[i] = new InetSocketTransportAddress(host, port);
      }

      Preconditions.checkState(serverAddresses != null
          && serverAddresses.length > 0, "Missing Param:" + HOSTNAMES);
    }
View Full Code Here

    parameters.put(TTL, "10");

    fixture = new ElasticSearchSink();
    fixture.configure(new Context(parameters));

    InetSocketTransportAddress[] expected = { new InetSocketTransportAddress(
        "10.5.5.27", DEFAULT_PORT) };

    assertEquals("testing-cluster-name", fixture.getClusterName());
    assertEquals("testing-index-name", fixture.getIndexName());
    assertEquals("testing-index-type", fixture.getIndexType());
View Full Code Here

    parameters.remove(CLUSTER_NAME);

    fixture = new ElasticSearchSink();
    fixture.configure(new Context(parameters));

    InetSocketTransportAddress[] expected = { new InetSocketTransportAddress(
        "10.5.5.27", DEFAULT_PORT) };

    assertEquals(DEFAULT_INDEX_NAME, fixture.getIndexName());
    assertEquals(DEFAULT_INDEX_TYPE, fixture.getIndexType());
    assertEquals(DEFAULT_CLUSTER_NAME, fixture.getClusterName());
View Full Code Here

    fixture = new ElasticSearchSink();
    fixture.configure(new Context(parameters));

    InetSocketTransportAddress[] expected = {
        new InetSocketTransportAddress("10.5.5.27", DEFAULT_PORT),
        new InetSocketTransportAddress("10.5.5.28", DEFAULT_PORT),
        new InetSocketTransportAddress("10.5.5.29", DEFAULT_PORT) };

    assertArrayEquals(expected, fixture.getServerAddresses());
  }
View Full Code Here

    fixture = new ElasticSearchSink();
    fixture.configure(new Context(parameters));

    InetSocketTransportAddress[] expected = {
        new InetSocketTransportAddress("10.5.5.27", 9300),
        new InetSocketTransportAddress("10.5.5.28", 9301),
        new InetSocketTransportAddress("10.5.5.29", 9302) };

    assertArrayEquals(expected, fixture.getServerAddresses());
  }
View Full Code Here

        }
    }

    @Override
    public ShellNativeClient newTransportClient() {
        return newTransportClient(new InetSocketTransportAddress(
                shellSettings.settings().get(ShellSettings.TRANSPORT_HOST),
                shellSettings.settings().getAsInt(ShellSettings.TRANSPORT_PORT, null)));
    }
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.