Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-12442

WebHdfsFileSystem#getFileBlockLocations will always return BlockLocation#corrupt as false

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Invalid
    • Affects Version/s: 2.9.0, 3.0.0-alpha2
    • Fix Version/s: None
    • Component/s: webhdfs
    • Labels:
      None

      Description

      Was going through JsonUtilClient#toBlockLocation code.
      Below is the relevant code snippet.

      JsonUtilClient.java
       /** Convert a Json map to BlockLocation. **/
        static BlockLocation toBlockLocation(Map<?, ?> m)
            throws IOException{
          ...
          ...  
          boolean corrupt = Boolean.
              getBoolean(m.get("corrupt").toString());
          ...
          ...
        }
      

      According to java docs for Boolean#getBoolean

      Returns true if and only if the system property named by the argument exists and is equal to the string "true". 
      

      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.

        Attachments

        1. HDFS-12442-1.patch
          3 kB
          Rushabh Shah

          Issue Links

            Activity

              People

              • Assignee:
                shahrs87 Rushabh Shah
                Reporter:
                shahrs87 Rushabh Shah
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: