You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Kai Zheng (JIRA)" <ji...@apache.org> on 2016/02/01 23:34:39 UTC
[jira] [Updated] (HADOOP-12744) Refactoring of checksum failure
report related codes
[ https://issues.apache.org/jira/browse/HADOOP-12744?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kai Zheng updated HADOOP-12744:
-------------------------------
Description:
This was from discussion with [~jingzhao] in HDFS-9646. There is some duplicate codes between client and datanode sides:
{code}
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);
}
}
{code}
This would resolve the duplication and also simplify the codes some bit.
was:This was from discussion with [~jingzhao] in HDFS-9646. Jing, wish you don't mind I'm handling it here. I planned to refactor the mentioned codes along with other codes related to the work in HDFS-9694, but I found the result patch there is too large, so separate it out here.
> Refactoring of checksum failure report related codes
> ----------------------------------------------------
>
> Key: HADOOP-12744
> URL: https://issues.apache.org/jira/browse/HADOOP-12744
> Project: Hadoop Common
> Issue Type: Improvement
> Reporter: Kai Zheng
> Assignee: Kai Zheng
> Attachments: HADOOP-12744-v1.patch
>
>
> This was from discussion with [~jingzhao] in HDFS-9646. There is some duplicate codes between client and datanode sides:
> {code}
> 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);
> }
> }
> {code}
> This would resolve the duplication and also simplify the codes some bit.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)