MCPcopy Create free account
hub / github.com/e2wugui/zeze / cancelPending

Method cancelPending

ZezeJava/ZezeJava/src/main/java/Zeze/Raft/Agent.java:444–459  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

442 }
443
444 public void cancelPending() {
445 // 不包括UrgentPending
446 if (pending.isEmpty())
447 return;
448
449 var removed = new ArrayList<RaftRpc<?, ?>>();
450 // Pending存在并发访问,这样写更可靠。
451 for (var rpc : pending) {
452 var r = pending.remove(rpc.getUnique().getRequestId());
453 if (null != r)
454 removed.add(r);
455 }
456 if (isDebugEnabled)
457 logger.debug("Found {} RaftRpc cancel", removed.size());
458 Task.getCriticalThreadPool().execute(() -> trigger(removed, "Cancel"));
459 }
460
461 private void resend(boolean immediately) {
462 ConnectorProxy leader = this.leader;

Callers

nothing calls this directly

Calls 9

getCriticalThreadPoolMethod · 0.95
triggerMethod · 0.95
getRequestIdMethod · 0.80
isEmptyMethod · 0.65
removeMethod · 0.65
getUniqueMethod · 0.65
addMethod · 0.65
sizeMethod · 0.65
executeMethod · 0.45

Tested by

no test coverage detected