Package org.elasticsearch.discovery.zen

Examples of org.elasticsearch.discovery.zen.DiscoveryNodesProvider


                addressA.address().getAddress().getHostAddress() + ":" + addressA.address().getPort(),
                addressB.address().getAddress().getHostAddress() + ":" + addressB.address().getPort())
                .build();

        UnicastZenPing zenPingA = new UnicastZenPing(hostsSettings, threadPool, transportServiceA, clusterName);
        zenPingA.setNodesProvider(new DiscoveryNodesProvider() {
            @Override public DiscoveryNodes nodes() {
                return DiscoveryNodes.newNodesBuilder().put(nodeA).localNodeId("A").build();
            }
        });
        zenPingA.start();

        UnicastZenPing zenPingB = new UnicastZenPing(hostsSettings, threadPool, transportServiceB, clusterName);
        zenPingB.setNodesProvider(new DiscoveryNodesProvider() {
            @Override public DiscoveryNodes nodes() {
                return DiscoveryNodes.newNodesBuilder().put(nodeB).localNodeId("B").build();
            }
        });
        zenPingB.start();
View Full Code Here


        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);
        zenPingA.setNodesProvider(new DiscoveryNodesProvider() {
            @Override public DiscoveryNodes nodes() {
                return DiscoveryNodes.newNodesBuilder().put(nodeA).localNodeId("A").build();
            }
        });
        zenPingA.start();

        MulticastZenPing zenPingB = new MulticastZenPing(threadPool, transportServiceB, clusterName);
        zenPingB.setNodesProvider(new DiscoveryNodesProvider() {
            @Override public DiscoveryNodes nodes() {
                return DiscoveryNodes.newNodesBuilder().put(nodeB).localNodeId("B").build();
            }
        });
        zenPingB.start();
View Full Code Here

TOP

Related Classes of org.elasticsearch.discovery.zen.DiscoveryNodesProvider

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.