Package net.kuujo.copycat.spi.protocol

Examples of net.kuujo.copycat.spi.protocol.ProtocolClient


    // Once we got the last log term, iterate through each current member
    // of the cluster and poll each member for a vote.
    LOGGER.info("{} - Polling members {}", context.clusterManager().localNode(), context.clusterManager().cluster().remoteMembers());
    final long lastTerm = lastEntry != null ? lastEntry.term() : 0;
    for (RemoteNode<?> node : (Set<RemoteNode<?>>) context.clusterManager().remoteNodes()) {
      final ProtocolClient client = node.client();
      client.connect().whenComplete((result1, error1) -> {
        if (error1 != null) {
          quorum.fail();
        } else {
          LOGGER.debug("{} - Polling {}", context.clusterManager().localNode(), node.member());
          client.poll(new PollRequest(context.nextCorrelationId(), context.currentTerm(), context.clusterManager()
            .localNode()
            .member()
            .id(), lastIndex, lastTerm)).whenComplete((result2, error2) -> {
            client.close();
            if (!complete.get()) {
              if (error2 != null) {
                LOGGER.warn(context.clusterManager().localNode().toString(), error2);
                quorum.fail();
              } else if (!result2.voteGranted()) {
View Full Code Here

TOP

Related Classes of net.kuujo.copycat.spi.protocol.ProtocolClient

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.