Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-7507 Fix findbugs warning in hadoop-hdfs project
  3. HDFS-7512

Fix byte to string encoding issues in hadoop-hdfs

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      In hadoop-hdfs, there are some bytes to string conversion using default charsets, which is flagged by findbugs 3.0 because the behavior of conversion depends on the platform settings of encoding. This jira proposes to fix the findbugs warnings below:

      Internationalization Warnings

      Code Warning
      Dm Found reliance on default encoding in org.apache.hadoop.hdfs.server.datanode.BlockReceiver.receiveBlock(DataOutputStream, DataInputStream, DataOutputStream, String, DataTransferThrottler, DatanodeInfo[], boolean): new java.io.FileWriter(File)
      Dm Found reliance on default encoding in org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.BlockPoolSlice.addToReplicasMap(ReplicaMap, File, RamDiskReplicaTracker, boolean): new java.util.Scanner(File)
      Dm Found reliance on default encoding in org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.BlockPoolSlice.loadDfsUsed(): new java.util.Scanner(File)
      Dm Found reliance on default encoding in org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.BlockPoolSlice.saveDfsUsed(): new java.io.FileWriter(File)
      Dm Found reliance on default encoding in org.apache.hadoop.hdfs.server.datanode.web.webhdfs.ExceptionHandler.exceptionCaught(Throwable): String.getBytes()
      Dm Found reliance on default encoding in org.apache.hadoop.hdfs.server.datanode.web.webhdfs.WebHdfsHandler.onGetFileChecksum(ChannelHandlerContext): String.getBytes()
      Dm Found reliance on default encoding in org.apache.hadoop.hdfs.server.mover.Mover$Cli.readPathFile(String): new java.io.FileReader(String)
      Dm Found reliance on default encoding in org.apache.hadoop.hdfs.server.namenode.FSDirStatAndListingOp.getListingInt(FSDirectory, String, byte[], boolean): new String(byte[])
      Dm Found reliance on default encoding in org.apache.hadoop.hdfs.server.namenode.FSImageUtil.<static initializer for FSImageUtil>(): String.getBytes()
      Dm Found reliance on default encoding in org.apache.hadoop.hdfs.server.namenode.INode.dumpTreeRecursively(PrintStream): new java.io.PrintWriter(OutputStream, boolean)
      Dm Found reliance on default encoding in org.apache.hadoop.hdfs.tools.offlineImageViewer.FSImageHandler.channelRead0(ChannelHandlerContext, HttpRequest): String.getBytes()
      Dm Found reliance on default encoding in org.apache.hadoop.hdfs.tools.offlineImageViewer.FSImageHandler.exceptionCaught(ChannelHandlerContext, Throwable): String.getBytes()
      Dm Found reliance on default encoding in org.apache.hadoop.hdfs.tools.offlineImageViewer.OfflineImageViewerPB.run(String[]): new java.io.PrintWriter(File)
      Dm Found reliance on default encoding in org.apache.hadoop.hdfs.tools.offlineImageViewer.OfflineImageViewerPB.run(String[]): new java.io.PrintWriter(OutputStream)

      Attachments

        1. HDFS-7512.0.patch
          13 kB
          Xiaoyu Yao

        Issue Links

          Activity

            People

              xyao Xiaoyu Yao
              xyao Xiaoyu Yao
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: