use of org.apache.ignite.raft.jraft.rpc.RpcRequests.TimeoutNowRequest in project ignite-3 by apache.
the class Replicator method sendTimeoutNow.
private void sendTimeoutNow(final boolean unlockId, final boolean stopAfterFinish, final int timeoutMs) {
TimeoutNowRequest req = raftOptions.getRaftMessagesFactory().timeoutNowRequest().term(options.getTerm()).groupId(options.getGroupId()).serverId(options.getServerId().toString()).peerId(options.getPeerId().toString()).build();
try {
if (!stopAfterFinish) {
// This RPC is issued by transfer_leadership, save this call_id so that
// the RPC can be cancelled by stop.
this.timeoutNowInFly = timeoutNow(req, false, timeoutMs);
this.timeoutNowIndex = 0;
} else {
timeoutNow(req, true, timeoutMs);
}
} finally {
if (unlockId) {
this.id.unlock();
}
}
}
Aggregations