[
https://issues.apache.org/jira/browse/HDFS-12915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300908#comment-16300908
]
SammiChen commented on HDFS-12915:
----------------------------------
bq. IIRC the unit test failed because %02x was printing as a literal, not as a
2-digit hex string using the passed parameter. Replacing an if/throw statement
with a call to a third-party library seems unnecessary. If it's not cleaner in
this case then its appeal, even aesthetically, is limited...
[~chris.douglas], thanks for the further explanation, I'm clear now. Also
thanks for the patch! I didn't realize it before.
bq. On a second thought, I think using ecPolicyID alone is sufficient, so that
we can eliminate blockType as parameter.
[~eddyxu], functionally I agree. While I would suggest to keep the
{{blockType}} for code readability. "0" {{ecPolicyID}} means continuous file
may confuse someone if he/she doesn't know the background.
> Fix findbugs warning in INodeFile$HeaderFormat.getBlockLayoutRedundancy
> -----------------------------------------------------------------------
>
> Key: HDFS-12915
> URL: https://issues.apache.org/jira/browse/HDFS-12915
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: namenode
> Affects Versions: 3.0.0
> Reporter: Wei-Chiu Chuang
> Attachments: HDFS-12915.00.patch, HDFS-12915.01.patch
>
>
> It seems HDFS-12840 creates a new findbugs warning.
> Possible null pointer dereference of replication in
> org.apache.hadoop.hdfs.server.namenode.INodeFile$HeaderFormat.getBlockLayoutRedundancy(BlockType,
> Short, Byte)
> Bug type NP_NULL_ON_SOME_PATH (click for details)
> In class org.apache.hadoop.hdfs.server.namenode.INodeFile$HeaderFormat
> In method
> org.apache.hadoop.hdfs.server.namenode.INodeFile$HeaderFormat.getBlockLayoutRedundancy(BlockType,
> Short, Byte)
> Value loaded from replication
> Dereferenced at INodeFile.java:[line 210]
> Known null at INodeFile.java:[line 207]
> From a quick look at the patch, it seems bogus though. [~eddyxu][~Sammi]
> would you please double check?
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]