Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,22 @@ public static SCMRegisteredResponseProto getRegisteredResponse(
return cmd.getProtoBufMessage();
}

private String constructCommandAuditMap(List<SCMCommandProto> cmds) {
StringBuilder auditMap = new StringBuilder();
auditMap.append('[');
for (SCMCommandProto cmd : cmds) {
if (cmd.getCommandType().equals(deleteBlocksCommand)) {
auditMap.append("commandType:" + cmd.getCommandType());
Comment thread
Tejaskriya marked this conversation as resolved.
Outdated
auditMap.append(" No. of deleteTransactions:");
Comment thread
Tejaskriya marked this conversation as resolved.
Outdated
auditMap.append(cmd.getDeleteBlocksCommandProto().getDeletedBlocksTransactionsList().size());
} else {
Comment thread
Tejaskriya marked this conversation as resolved.
Outdated
auditMap.append(cmd);
}
}
auditMap.append(']');
return auditMap.toString();
}

@Override
public SCMHeartbeatResponseProto sendHeartbeat(
SCMHeartbeatRequestProto heartbeat) throws IOException, TimeoutException {
Expand All @@ -291,7 +307,7 @@ public SCMHeartbeatResponseProto sendHeartbeat(
boolean auditSuccess = true;
Map<String, String> auditMap = Maps.newHashMap();
auditMap.put("datanodeUUID", heartbeat.getDatanodeDetails().getUuid());
auditMap.put("command", flatten(cmdResponses.toString()));
auditMap.put("command", flatten(constructCommandAuditMap(cmdResponses)));
term.ifPresent(t -> auditMap.put("term", String.valueOf(t)));
try {
SCMHeartbeatResponseProto.Builder builder =
Expand Down