Examples of boundAddress()


Examples of org.elasticsearch.http.HttpServerTransport.boundAddress()

    private HttpPost httpPost;

    @Before
    public void setup() {
        HttpServerTransport httpServerTransport = cluster().getInstance(HttpServerTransport.class);
        InetSocketAddress address = ((InetSocketTransportAddress) httpServerTransport.boundAddress().publishAddress())
                .address();
        httpPost = new HttpPost(String.format("http://%s:%s/_sql?error_trace", address.getHostName(), address.getPort()));
    }

    protected CloseableHttpClient httpClient = HttpClients.createDefault();
View Full Code Here

Examples of org.elasticsearch.http.HttpServerTransport.boundAddress()

    @Test
    public void testThatNettyHttpServerSupportsPipelining() throws Exception {
        List<String> requests = Arrays.asList("/", "/_nodes/stats", "/", "/_cluster/state", "/");

        HttpServerTransport httpServerTransport = internalCluster().getInstance(HttpServerTransport.class);
        InetSocketTransportAddress inetSocketTransportAddress = (InetSocketTransportAddress) httpServerTransport.boundAddress().boundAddress();

        try (NettyHttpClient nettyHttpClient = new NettyHttpClient()) {
            Collection<HttpResponse> responses = nettyHttpClient.sendRequests(inetSocketTransportAddress.address(), requests.toArray(new String[]{}));
            assertThat(responses, hasSize(5));
View Full Code Here

Examples of org.elasticsearch.http.HttpServerTransport.boundAddress()

    public void testThatNettyHttpServerDoesNotSupportPipelining() throws Exception {
        ensureGreen();
        List<String> requests = Arrays.asList("/", "/_nodes/stats", "/", "/_cluster/state", "/", "/_nodes", "/");

        HttpServerTransport httpServerTransport = internalCluster().getInstance(HttpServerTransport.class);
        InetSocketTransportAddress inetSocketTransportAddress = (InetSocketTransportAddress) httpServerTransport.boundAddress().boundAddress();

        try (NettyHttpClient nettyHttpClient = new NettyHttpClient()) {
            Collection<HttpResponse> responses = nettyHttpClient.sendRequests(inetSocketTransportAddress.address(), requests.toArray(new String[]{}));
            assertThat(responses, hasSize(requests.size()));
View Full Code Here

Examples of org.elasticsearch.transport.Transport.boundAddress()

                    .put("cluster.name", internalCluster().getClusterName())
                    .put("name", "programmatic_transport_client")
                    .put("client.transport.nodes_sampler_interval", "1s")
                    .build());
            Transport transport = internalCluster().getDataNodeInstance(Transport.class);
            transportClient.addTransportAddress(transport.boundAddress().publishAddress());
        }

        return transportClient;
    }
View Full Code Here

Examples of org.elasticsearch.transport.TransportService.boundAddress()

    @Test public void testSimplePings() {
        ThreadPool threadPool = new ThreadPool();
        ClusterName clusterName = new ClusterName("test");
        NettyTransport transportA = new NettyTransport(threadPool);
        final TransportService transportServiceA = new TransportService(transportA, threadPool).start();
        final DiscoveryNode nodeA = new DiscoveryNode("A", transportServiceA.boundAddress().publishAddress());

        InetSocketTransportAddress addressA = (InetSocketTransportAddress) transportA.boundAddress().publishAddress();

        NettyTransport transportB = new NettyTransport(threadPool);
        final TransportService transportServiceB = new TransportService(transportB, threadPool).start();
View Full Code Here

Examples of org.elasticsearch.transport.TransportService.boundAddress()

    @Test public void testSimplePings() {
        ThreadPool threadPool = new ThreadPool();
        ClusterName clusterName = new ClusterName("test");
        final TransportService transportServiceA = new TransportService(new LocalTransport(threadPool), threadPool).start();
        final DiscoveryNode nodeA = new DiscoveryNode("A", transportServiceA.boundAddress().publishAddress());

        final TransportService transportServiceB = new TransportService(new LocalTransport(threadPool), threadPool).start();
        final DiscoveryNode nodeB = new DiscoveryNode("B", transportServiceA.boundAddress().publishAddress());

        MulticastZenPing zenPingA = new MulticastZenPing(threadPool, transportServiceA, clusterName);
View Full Code Here

Examples of org.elasticsearch.transport.TransportService.boundAddress()

        NetworkService networkService = new NetworkService(settings);
        ElectMasterService electMasterService = new ElectMasterService(settings);

        NettyTransport transportA = new NettyTransport(settings, threadPool, networkService, BigArrays.NON_RECYCLING_INSTANCE, Version.CURRENT);
        final TransportService transportServiceA = new TransportService(transportA, threadPool).start();
        final DiscoveryNode nodeA = new DiscoveryNode("UZP_A", transportServiceA.boundAddress().publishAddress(), Version.CURRENT);

        InetSocketTransportAddress addressA = (InetSocketTransportAddress) transportA.boundAddress().publishAddress();

        NettyTransport transportB = new NettyTransport(settings, threadPool, networkService, BigArrays.NON_RECYCLING_INSTANCE, Version.CURRENT);
        final TransportService transportServiceB = new TransportService(transportB, threadPool).start();
View Full Code Here

Examples of org.elasticsearch.transport.TransportService.boundAddress()

        settings = buildRandomMulticast(settings);

        ThreadPool threadPool = new ThreadPool("testSimplePings");
        final ClusterName clusterName = new ClusterName("test");
        final TransportService transportServiceA = new TransportService(new LocalTransport(settings, threadPool, Version.CURRENT), threadPool).start();
        final DiscoveryNode nodeA = new DiscoveryNode("A", transportServiceA.boundAddress().publishAddress(), Version.CURRENT);

        final TransportService transportServiceB = new TransportService(new LocalTransport(settings, threadPool, Version.CURRENT), threadPool).start();
        final DiscoveryNode nodeB = new DiscoveryNode("B", transportServiceB.boundAddress().publishAddress(), Version.CURRENT);

        MulticastZenPing zenPingA = new MulticastZenPing(threadPool, transportServiceA, clusterName, Version.CURRENT);
View Full Code Here

Examples of org.elasticsearch.transport.TransportService.boundAddress()

        final ClusterName clusterName = new ClusterName("test");
        final TransportService transportServiceA = new TransportService(new LocalTransport(settings, threadPool, Version.CURRENT), threadPool).start();
        final DiscoveryNode nodeA = new DiscoveryNode("A", transportServiceA.boundAddress().publishAddress(), Version.CURRENT);

        final TransportService transportServiceB = new TransportService(new LocalTransport(settings, threadPool, Version.CURRENT), threadPool).start();
        final DiscoveryNode nodeB = new DiscoveryNode("B", transportServiceB.boundAddress().publishAddress(), Version.CURRENT);

        MulticastZenPing zenPingA = new MulticastZenPing(threadPool, transportServiceA, clusterName, Version.CURRENT);
        zenPingA.setPingContextProvider(new PingContextProvider() {
            @Override
            public DiscoveryNodes nodes() {
View Full Code Here

Examples of org.elasticsearch.transport.TransportService.boundAddress()

        settings = buildRandomMulticast(settings);

        final ThreadPool threadPool = new ThreadPool("testExternalPing");
        final ClusterName clusterName = new ClusterName("test");
        final TransportService transportServiceA = new TransportService(new LocalTransport(settings, threadPool, Version.CURRENT), threadPool).start();
        final DiscoveryNode nodeA = new DiscoveryNode("A", transportServiceA.boundAddress().publishAddress(), Version.CURRENT);

        MulticastZenPing zenPingA = new MulticastZenPing(threadPool, transportServiceA, clusterName, Version.CURRENT);
        zenPingA.setPingContextProvider(new PingContextProvider() {
            @Override
            public DiscoveryNodes nodes() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.