Package org.apache.helix.resolver

Examples of org.apache.helix.resolver.HelixAddress


      final Random random = new Random();

      @Override
      public void onMessage(HelixMessageScope scope, UUID messageId, ByteBuf message) {
        if (random.nextInt() % 2 == 0) {
          HelixAddress sender = firstResolver.getSource(scope);
          firstIPC.send(sender, ackMessageType, messageId, null);
        }
      }
    });
    firstIPC.start();

    // Second IPC service
    final HelixIPCService secondIPC =
        new NettyHelixIPCService(new NettyHelixIPCService.Config().setInstanceName(
            secondNode.getInstanceName()).setPort(secondPort));
    secondIPC.registerCallback(messageType, new HelixIPCCallback() {
      final Random random = new Random();

      @Override
      public void onMessage(HelixMessageScope scope, UUID messageId, ByteBuf message) {
        if (random.nextInt() % 2 == 0) {
          HelixAddress sender = secondResolver.getSource(scope);
          secondIPC.send(sender, ackMessageType, messageId, null);
        }
      }
    });
    secondIPC.start();
View Full Code Here


                HelixMessageScope scope =
                    new HelixMessageScope.Builder().cluster("CLUSTER").resource("RESOURCE")
                        .partition("PARTITION_" + i).sourceInstance(localhost + "_" + port).build();

                Set<HelixAddress> destinations =
                    ImmutableSet.of(new HelixAddress(scope, remoteHost + "_" + remotePort,
                        new InetSocketAddress(remoteHost, remotePort)));

                UUID uuid = UUID.randomUUID();

                try {
View Full Code Here

TOP

Related Classes of org.apache.helix.resolver.HelixAddress

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.