@Value.Check protected final void check() { Preconditions.checkState(quorumSize() > leaders().size() / 2, "The quorumSize '%s' must be over half the amount of leader entries %s.", quorumSize(), leaders()); Preconditions.checkState(leaders().size() >= quorumSize(), "The quorumSize '%s' must be less than or equal to the amount of leader entries %s.", quorumSize(), leaders()); Preconditions.checkArgument(leaders().contains(localServer()), "The localServer '%s' must included in the leader entries %s.", localServer(), leaders()); Preconditions.checkArgument(ensureDirectoryExists(learnerLogDir()), "Learner log directory '%s' does not exist and cannot be created.", learnerLogDir()); Preconditions.checkArgument(ensureDirectoryExists(acceptorLogDir()), "Acceptor log directory '%s' does not exist and cannot be created.", acceptorLogDir()); }
PaxosAcceptorImpl.newAcceptor(config.acceptorLogDir().getPath())); PaxosLearner ourLearner = AtlasDbMetrics.instrument(metricsManager.getRegistry(), PaxosLearner.class,
@Value.Check protected final void check() { Preconditions.checkState(quorumSize() > leaders().size() / 2, "The quorumSize '%s' must be over half the amount of leader entries %s.", quorumSize(), leaders()); Preconditions.checkState(leaders().size() >= quorumSize(), "The quorumSize '%s' must be less than or equal to the amount of leader entries %s.", quorumSize(), leaders()); Preconditions.checkArgument(leaders().contains(localServer()), "The localServer '%s' must included in the leader entries %s.", localServer(), leaders()); Preconditions.checkArgument(ensureDirectoryExists(learnerLogDir()), "Learner log directory '%s' does not exist and cannot be created.", learnerLogDir()); Preconditions.checkArgument(ensureDirectoryExists(acceptorLogDir()), "Acceptor log directory '%s' does not exist and cannot be created.", acceptorLogDir()); }
PaxosAcceptorImpl.newAcceptor(config.acceptorLogDir().getPath())); PaxosLearner ourLearner = AtlasDbMetrics.instrument(metricsManager.getRegistry(), PaxosLearner.class,