Package org.robotninjas.barge.state.Raft

Examples of org.robotninjas.barge.state.Raft.StateType


  }

  @Nonnull
  @Override
  public ListenableFuture<Object> commitOperation(@Nonnull RaftStateContext ctx, @Nonnull byte[] operation) throws RaftException {
    StateType stateType = ctx.type();
    Preconditions.checkNotNull(stateType);
    if (stateType.equals(FOLLOWER)) {
      throw new NotLeaderException(leader.get());
    } else if (stateType.equals(CANDIDATE)) {
      throw new NoLeaderException();
    }
    return Futures.immediateCancelledFuture();
  }
View Full Code Here

TOP

Related Classes of org.robotninjas.barge.state.Raft.StateType

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.