use of org.apache.ratis.protocol.exceptions.ServerNotReadyException in project incubator-ratis by apache.
the class RaftServerImpl method preAppendEntriesAsync.
private void preAppendEntriesAsync(RaftPeerId leaderId, RaftGroupId leaderGroupId, long leaderTerm, TermIndex previous, long leaderCommit, boolean initializing, LogEntryProto... entries) throws IOException {
CodeInjectionForTesting.execute(APPEND_ENTRIES, getId(), leaderId, leaderTerm, previous, leaderCommit, initializing, entries);
assertLifeCycleState(LifeCycle.States.STARTING_OR_RUNNING);
if (!startComplete.get()) {
throw new ServerNotReadyException(getMemberId() + ": The server role is not yet initialized.");
}
assertGroup(leaderId, leaderGroupId);
try {
validateEntries(leaderTerm, previous, entries);
} catch (IllegalArgumentException e) {
throw new IOException(e);
}
}
Aggregations