Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
-
Reviewed
Description
This was from discussion with jingzhao in HDFS-9646. There is some duplicate codes between client and datanode sides:
private void addCorruptedBlock(ExtendedBlock blk, DatanodeInfo node, Map<ExtendedBlock, Set<DatanodeInfo>> corruptionMap) { Set<DatanodeInfo> dnSet = corruptionMap.get(blk); if (dnSet == null) { dnSet = new HashSet<>(); corruptionMap.put(blk, dnSet); } if (!dnSet.contains(node)) { dnSet.add(node); } }
This would resolve the duplication and also simplify the codes some bit.