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

The default 8KB buffer of BlockReaderRemote#newBlockReader#BufferedOutputStream is too big

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.3.0
    • None
    • None
    • Reduce the output stream buffer size of a DFSClient remote read from 8KB to 512 bytes.

    Description

      this issue is similar to HDFS-14535.

      public static BlockReader newBlockReader(String file,
          ExtendedBlock block,
          Token<BlockTokenIdentifier> blockToken,
          long startOffset, long len,
          boolean verifyChecksum,
          String clientName,
          Peer peer, DatanodeID datanodeID,
          PeerCache peerCache,
          CachingStrategy cachingStrategy,
          int networkDistance) throws IOException {
        // in and out will be closed when sock is closed (by the caller)
        final DataOutputStream out = new DataOutputStream(new BufferedOutputStream(
            peer.getOutputStream()));
        new Sender(out).readBlock(block, blockToken, clientName, startOffset, len,
            verifyChecksum, cachingStrategy);
      }
      
      public BufferedOutputStream(OutputStream out) {
          this(out, 8192);
      }
      

      Sender#readBlock parameter( block,blockToken, clientName, startOffset, len, verifyChecksum, cachingStrategy) could not use such a big buffer.
      So i think it should reduce BufferedOutputStream buffer.

      Attachments

        1. HDFS-14820.003.patch
          3 kB
          Lisheng Sun
        2. HDFS-14820.002.patch
          2 kB
          Lisheng Sun
        3. HDFS-14820.001.patch
          3 kB
          Lisheng Sun

        Issue Links

          Activity

            People

              leosun08 Lisheng Sun
              leosun08 Lisheng Sun
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: