Package org.elasticsearch.common.transport

Examples of org.elasticsearch.common.transport.InetSocketTransportAddress


                    .build();

            TransportClient transportClient = new TransportClient(settings);
            for (String esHostName : hostNames) {
                LOG.info("Adding TransportClient: {}", esHostName);
                transportClient = transportClient.addTransportAddress(new InetSocketTransportAddress(esHostName,
                        DEFAULT_ELASTICSEARCH_PORT));
            }
            client = transportClient;
        }
View Full Code Here


                getServerListFromDiscovery(addressList, discoveryClient, client);
            } else {
                for (String address : addressList) {
                    String[] host_port = address.split(":");
                    ((TransportClient)client).addTransportAddress(
                            new InetSocketTransportAddress(host_port[0], Integer.parseInt(host_port[1])));
                }
            }
        }

        setName(ElasticSearchSink.class.getSimpleName() + "-" + settings.get("cluster.name"));
View Full Code Here

            List<InstanceInfo> listOfinstanceInfo = discoveryClient.getInstancesByVipAddress(host_port[0], false);
            for (InstanceInfo ii : listOfinstanceInfo) {
                if (ii.getStatus().equals(InstanceInfo.InstanceStatus.UP)) {
                    ((TransportClient)client).addTransportAddress(
                            new InetSocketTransportAddress(ii.getHostName(), Integer.parseInt(host_port[1])));
                }
            }
        }
    }
View Full Code Here

        // note, we rely on the fact that its a new id each time we start, see FD and "kill -9" handling
        String nodeId = UUID.randomUUID().toString();
        String host = settings.get("discovery.publish.host");
        String port = settings.get("discovery.publish.port");
        if (host != null && port != null) {
            TransportAddress address = new InetSocketTransportAddress(host, Integer.parseInt(port));
            localNode = new DiscoveryNode(settings.get("name"), nodeId, address, nodeAttributes, Version.CURRENT);
        } else {
            localNode = new DiscoveryNode(settings.get("name"), nodeId, transportService.boundAddress().publishAddress(), nodeAttributes, Version.CURRENT);
        }
        tracker.open();
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

                String[] hostparts = host.split(":");
                String hostname = hostparts[0];
                int hostport = HOST_PORT_DEFAULT;
                if (hostparts.length == 2) hostport = Integer.parseInt(hostparts[1]);
                log.info("Configured remote host: {} : {}", hostname, hostport);
                tc.addTransportAddress(new InetSocketTransportAddress(hostname, hostport));
            }
            client = tc;
            node = null;
        }
View Full Code Here

                        {
                            log.error("Host or port should not be null / port should be numeric");
                            throw new IllegalArgumentException(
                                    "Host or port should not be null / port should be numeric");
                        }
                        ((TransportClient) client).addTransportAddress(new InetSocketTransportAddress(properties
                                .getProperty("host"), Integer.parseInt(properties.getProperty("port"))));
                    }
                }
            }
        }
View Full Code Here

      
        org.elasticsearch.client.Client client = new TransportClient(settings);

        for (String h : hosts)
        {
            ((TransportClient) client).addTransportAddress(new InetSocketTransportAddress(h, new Integer(port)));
        }
       
        return client;
    }
View Full Code Here

        clusterService = mock(ClusterService.class);
        clusterIdService = mock(ClusterIdService.class);
        httpServerTransport = mock(HttpServerTransport.class);
        DiscoveryNode discoveryNode = mock(DiscoveryNode.class);
        BoundTransportAddress boundAddress = mock(BoundTransportAddress.class);
        TransportAddress transportAddress = new InetSocketTransportAddress(
                InetAddress.getLocalHost().getHostName(), 4200);

        SettableFuture<ClusterId> clusterIdFuture = SettableFuture.create();
        clusterIdFuture.set(new ClusterId(UUID.randomUUID()));
        when(clusterIdService.clusterId()).thenReturn(clusterIdFuture);
View Full Code Here

            String host = parts[0];
            Integer port = 4300;
            if (parts.length == 2) {
                port = Integer.parseInt(parts[1]);
            }
            internalClient.addTransportAddress(new InetSocketTransportAddress(host, port));
        }
    }
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.