Source:
<code>public void handleFailureDetectedMsg(CorfuPayloadMsg<DetectorMsg> msg, ChannelHandlerContext ctx, IServerRouter r) { if (!checkBootstrap(msg)) { r.sendResponse(ctx, msg, new CorfuMsg(CorfuMsgType.MANAGEMENT_NOBOOTSTRAP_ERROR)); return; } log.info("handleFailureDetectedMsg: Received DetectorMsg : {}", msg.getPayload()); DetectorMsg detectorMsg = msg.getPayload(); Layout layout = serverContext.copyManagementLayout(); if (!detectorMsg.getDetectorEpoch().equals(layout.getEpoch())) { log.error("handleFailureDetectedMsg: Discarding stale detector message received. " + "detectorEpoch:{} latestLayout epoch:{}", detectorMsg.getDetectorEpoch(), layout.getEpoch()); r.sendResponse(ctx, msg, new CorfuMsg(CorfuMsgType.NACK)); return; } final Set<String> allActiveServers = layout.getAllActiveServers(); final Set<String> responsiveFailedNodes = detectorMsg.getFailedNodes() .stream() .filter(allActiveServers::contains) .collect(Collectors.toSet()); if (responsiveFailedNodes.isEmpty()) { log.warn("handleFailureDetectedMsg: No action is taken as none of the failed nodes " + <START> "are responsive. failedNodes:{} responsive layout nodes: {}, " + <END> "latestLayout epoch:{} ", detectorMsg.getFailedNodes(), allActiveServers, layout.getEpoch()); r.sendResponse(ctx, msg, new CorfuMsg(CorfuMsgType.ACK)); return; } boolean result = ReconfigurationEventHandler.handleFailure( failureHandlerPolicy, layout, managementAgent.getCorfuRuntime(), responsiveFailedNodes); if (result) { r.sendResponse(ctx, msg, new CorfuMsg(CorfuMsgType.ACK)); } else { log.error("handleFailureDetectedMsg: failure handling unsuccessful."); r.sendResponse(ctx, msg, new CorfuMsg(CorfuMsgType.NACK)); } }</code><technical_language>Please JsonUtils</technical_language>

Target:
public void handleFailureDetectedMsg(CorfuPayloadMsg<DetectorMsg> msg, ChannelHandlerContext ctx, IServerRouter r) { if (!checkBootstrap(msg)) { r.sendResponse(ctx, msg, new CorfuMsg(CorfuMsgType.MANAGEMENT_NOBOOTSTRAP_ERROR)); return; } log.info("handleFailureDetectedMsg: Received DetectorMsg : {}", msg.getPayload()); DetectorMsg detectorMsg = msg.getPayload(); Layout layout = serverContext.copyManagementLayout(); if (!detectorMsg.getDetectorEpoch().equals(layout.getEpoch())) { log.error("handleFailureDetectedMsg: Discarding stale detector message received. " + "detectorEpoch:{} latestLayout epoch:{}", detectorMsg.getDetectorEpoch(), layout.getEpoch()); r.sendResponse(ctx, msg, new CorfuMsg(CorfuMsgType.NACK)); return; } final Set<String> allActiveServers = layout.getAllActiveServers(); final Set<String> responsiveFailedNodes = detectorMsg.getFailedNodes() .stream() .filter(allActiveServers::contains) .collect(Collectors.toSet()); if (!detectorMsg.getFailedNodes().isEmpty() && responsiveFailedNodes.isEmpty()) { log.warn("handleFailureDetectedMsg: No action is taken as none of the failed nodes " + "are responsive. failedNodes:{} responsive layout nodes: {}, " + "latestLayout epoch:{} ", detectorMsg.getFailedNodes(), allActiveServers, layout.getEpoch()); r.sendResponse(ctx, msg, new CorfuMsg(CorfuMsgType.ACK)); return; } boolean result = ReconfigurationEventHandler.handleFailure( failureHandlerPolicy, layout, managementAgent.getCorfuRuntime(), responsiveFailedNodes); if (result) { r.sendResponse(ctx, msg, new CorfuMsg(CorfuMsgType.ACK)); } else { log.error("handleFailureDetectedMsg: failure handling unsuccessful."); r.sendResponse(ctx, msg, new CorfuMsg(CorfuMsgType.NACK)); } }