Package org.elasticsearch.common.transport

Examples of org.elasticsearch.common.transport.TransportAddress


        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


            Discovery discovery = mock(Discovery.class);
            bind(Discovery.class).toInstance(discovery);
            when(discovery.localNode()).thenReturn(node);
            when(node.getId()).thenReturn("node-id-1");
            when(node.getName()).thenReturn("node 1");
            TransportAddress transportAddress = new InetSocketTransportAddress("localhost", 44300);
            when(node.address()).thenReturn(transportAddress);

            NetworkStats.Tcp tcp = mock(NetworkStats.Tcp.class, new Answer<Long>() {
                @Override
                public Long answer(InvocationOnMock invocation) throws Throwable {
View Full Code Here

            put("failure", failCounter.get());
        }};
    }

    public String getHardwareAddress() {
        TransportAddress transportAddress = httpServerTransport.boundAddress().publishAddress();
        if (!(transportAddress instanceof InetSocketTransportAddress)) {
            return null;
        }

        String hardwareAddress = null;
View Full Code Here

        Settings settings = ImmutableSettings.builder().put(requiredSettings()).put("client.transport.nodes_sampler_interval", "1s")
                .put("name", "transport_client_sniff_mode").put(ClusterName.SETTING, cluster().getClusterName())
                .put("client.transport.sniff", true).build();

        CompositeTestCluster compositeTestCluster = backwardsCluster();
        TransportAddress transportAddress = compositeTestCluster.externalTransportAddress();

        try(TransportClient client = new TransportClient(settings)) {
            client.addTransportAddress(transportAddress);

            assertAcked(client.admin().indices().prepareCreate("test"));
View Full Code Here

                .put("config.ignore_system_properties", true) // make sure we get what we set :)
                .put("gateway.type", "none")
                .build()).clusterName("foobar").build();
        node.start();
        try {
            TransportAddress transportAddress = ((InternalNode) node).injector().getInstance(TransportService.class).boundAddress().publishAddress();
            client.addTransportAddress(transportAddress);
            assertThat(nodeService.connectedNodes().size(), greaterThanOrEqualTo(1)); // since we force transport clients there has to be one node started that we connect to.
            for (DiscoveryNode discoveryNode : nodeService.connectedNodes()) {  // connected nodes have updated version
                assertThat(discoveryNode.getVersion(), equalTo(Version.CURRENT));
            }
View Full Code Here

            process.addNodeStats(nodeResponse.nodeStats());
            jvm.addNodeInfoStats(nodeResponse.nodeInfo(), nodeResponse.nodeStats());
            plugins.addAll(nodeResponse.nodeInfo().getPlugins().getInfos());

            // now do the stats that should be deduped by hardware (implemented by ip deduping)
            TransportAddress publishAddress = nodeResponse.nodeInfo().getTransport().address().publishAddress();
            InetAddress inetAddress = null;
            if (publishAddress.uniqueAddressTypeId() == 1) {
                inetAddress = ((InetSocketTransportAddress) publishAddress).address().getAddress();
            }

            if (!seenAddresses.add(inetAddress)) {
                continue;
View Full Code Here

TOP

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

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.