@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()); }
MetricRegistry.name(PaxosProposer.class, "executor")); PaxosProposer proposer = AtlasDbMetrics.instrument(metricsManager.getRegistry(), PaxosProposer.class, PaxosProposerImpl.newProposer(ourLearner, acceptors, learners, config.quorumSize(), leaderUuid, proposerExecutorService));
@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()); }
MetricRegistry.name(PaxosProposer.class, "executor")); PaxosProposer proposer = AtlasDbMetrics.instrument(metricsManager.getRegistry(), PaxosProposer.class, PaxosProposerImpl.newProposer(ourLearner, acceptors, learners, config.quorumSize(), leaderUuid, proposerExecutorService));