hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Weiwei Yang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-12442) WebHdfsFileSystem#getFileBlockLocations will always return BlockLocation#corrupt as false
Date Thu, 14 Sep 2017 02:55:00 GMT

    [ https://issues.apache.org/jira/browse/HDFS-12442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16165640#comment-16165640
] 

Weiwei Yang commented on HDFS-12442:
------------------------------------

Hi [~shahrs87]

Thank you for catching this up and the fix. That was a mis-use of the API like you pointed
out, can we replace that with {{Boolean.parseBoolean()}}? Other seems good to me. But I am
not a committer yet, guess you need some one else to help review and the commit, thank you.

> WebHdfsFileSystem#getFileBlockLocations will always return BlockLocation#corrupt as false
> -----------------------------------------------------------------------------------------
>
>                 Key: HDFS-12442
>                 URL: https://issues.apache.org/jira/browse/HDFS-12442
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: webhdfs
>    Affects Versions: 2.9.0, 3.0.0-alpha2
>            Reporter: Rushabh S Shah
>            Assignee: Rushabh S Shah
>            Priority: Critical
>         Attachments: HDFS-12442-1.patch
>
>
> Was going through {{JsonUtilClient#toBlockLocation}} code.
> Below is the relevant code snippet.
> {code:title=JsonUtilClient.java|borderStyle=solid}
>  /** Convert a Json map to BlockLocation. **/
>   static BlockLocation toBlockLocation(Map<?, ?> m)
>       throws IOException{
>     ...
>     ...  
>     boolean corrupt = Boolean.
>         getBoolean(m.get("corrupt").toString());
>     ...
>     ...
>   }
> {code}
> According to java docs for {{Boolean#getBoolean}}
> {noformat}
> Returns true if and only if the system property named by the argument exists and is equal
to the string "true". 
> {noformat}
> I assume, the map value for key {{corrupt}} will be populated with either {{true}} or
{{false}}.
> On the client side, {{Boolean#getBoolean}} will look for system property for true or
false.
> So it will always return false unless the system property is set for true or false.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message