Package org.apache.helix.resolver

Examples of org.apache.helix.resolver.HelixMessageScope$Builder


        } else if (callbacks.get(messageType) == null) {
          throw new IllegalStateException("No callback registered for message type " + messageType);
        }

        // Build scope
        HelixMessageScope scope =
            new HelixMessageScope.Builder().cluster(clusterName).resource(resourceName)
                .partition(partitionName).state(state).sourceInstance(srcInstance).build();

        // Get callback
        HelixIPCCallback callback = callbacks.get(messageType);
View Full Code Here


    }

    // And use first node to send messages to them
    for (String partitionName : secondPartitions) {
      for (int i = 0; i < numMessages; i++) {
        HelixMessageScope scope =
            new HelixMessageScope.Builder().cluster(firstNode.getClusterName())
                .resource(RESOURCE_NAME).partition(partitionName).state("ONLINE").build();

        Set<HelixAddress> destinations = firstResolver.getDestinations(scope);
        for (HelixAddress destination : destinations) {
          ByteBuf message = Unpooled.wrappedBuffer(("Hello" + i).getBytes());
          firstIPC.send(destination, messageType, UUID.randomUUID(), message);
        }
      }
    }

    // Loopback
    for (String partitionName : secondPartitions) {
      for (int i = 0; i < numMessages; i++) {
        HelixMessageScope scope =
            new HelixMessageScope.Builder().cluster(secondNode.getClusterName())
                .resource(RESOURCE_NAME).partition(partitionName).state("ONLINE").build();

        Set<HelixAddress> destinations = secondResolver.getDestinations(scope);
        for (HelixAddress destination : destinations) {
View Full Code Here

    }

    // And use first node to send messages to them
    for (String partitionName : secondPartitions) {
      for (int i = 0; i < numMessages; i++) {
        HelixMessageScope scope =
            new HelixMessageScope.Builder().cluster(firstNode.getClusterName())
                .resource(RESOURCE_NAME).partition(partitionName).state("ONLINE").build();
        Set<HelixAddress> destinations = firstResolver.getDestinations(scope);
        for (HelixAddress destination : destinations) {
          ByteBuf message = Unpooled.wrappedBuffer(("Hello" + i).getBytes());
View Full Code Here

          public void run() {
            ByteBuf m = ByteBufAllocator.DEFAULT.buffer(messageBytes.length);
            m.writeBytes(messageBytes);
            while (!isShutdown.get()) {
              for (int i = 0; i < numPartitions; i++) {
                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,
View Full Code Here

TOP

Related Classes of org.apache.helix.resolver.HelixMessageScope$Builder

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.