Package net.kuujo.copycat

Examples of net.kuujo.copycat.CopycatException


   * Commits the given index to the replica.
   */
  CompletableFuture<Long> replicate(long index) {
    if (!open) {
      CompletableFuture<Long> future = new CompletableFuture<>();
      future.completeExceptionally(new CopycatException("Connection not open"));
      return future;
    }

    if (index <= matchIndex) {
      return CompletableFuture.completedFuture(index);
View Full Code Here


              triggerReplicateFutures(prevIndex + 1, prevIndex + entries.size());
              replicate();
            }
          } else {
            if (response.term() > state.currentTerm()) {
              triggerReplicateFutures(prevIndex, prevIndex, new CopycatException("Not the leader"));
              state.transition(FollowerController.class);
            } else {
              // If replication failed then use the last log index indicated by
              // the replica in the response to generate a new nextIndex. This allows
              // us to skip repeatedly replicating one entry at a time if it's not
View Full Code Here

TOP

Related Classes of net.kuujo.copycat.CopycatException

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.