Package net.kuujo.copycat.internal.util

Examples of net.kuujo.copycat.internal.util.Quorum.fail()


    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()
View Full Code Here


            .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()) {
                LOGGER.info("{} - Received rejected vote from {}", context.clusterManager().localNode(), node.member());
                quorum.fail();
              } else if (result2.term() != context.currentTerm()) {
                LOGGER.info("{} - Received successful vote for a different term from {}", context.clusterManager()
View Full Code Here

              if (error2 != null) {
                LOGGER.warn(context.clusterManager().localNode().toString(), error2);
                quorum.fail();
              } else if (!result2.voteGranted()) {
                LOGGER.info("{} - Received rejected vote from {}", context.clusterManager().localNode(), node.member());
                quorum.fail();
              } else if (result2.term() != context.currentTerm()) {
                LOGGER.info("{} - Received successful vote for a different term from {}", context.clusterManager()
                  .localNode(), node.member());
                quorum.fail();
              } else {
View Full Code Here

                LOGGER.info("{} - Received rejected vote from {}", context.clusterManager().localNode(), node.member());
                quorum.fail();
              } else if (result2.term() != context.currentTerm()) {
                LOGGER.info("{} - Received successful vote for a different term from {}", context.clusterManager()
                  .localNode(), node.member());
                quorum.fail();
              } else {
                LOGGER.info("{} - Received successful vote from {}", context.clusterManager()
                  .localNode(), node.member());
                quorum.succeed();
              }
View Full Code Here

        // Once the commit succeeds, check the commit index of all replicas.
        if (error == null) {
          quorum.succeed();
          checkCommits();
        } else {
          quorum.fail();
        }
      });
    }
    return future;
  }
View Full Code Here

    for (NodeReplicator replica : replicaMap.values()) {
      replica.ping(index).whenComplete((resultIndex, error) -> {
        if (error == null) {
          quorum.succeed();
        } else {
          quorum.fail();
        }
      });
    }
    return future;
  }
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.