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

return buffer into direct bufferPool in BlockReaderLocal as possible

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 3.0.0-alpha1
    • None
    • datanode
    • None

    Description

        public synchronized void close() throws IOException {
          dataIn.close();
          if (checksumIn != null) {
            checksumIn.close();
          }
          if (slowReadBuff != null) {
            bufferPool.returnBuffer(slowReadBuff);
            slowReadBuff = null;
          }
          if (checksumBuff != null) {
            bufferPool.returnBuffer(checksumBuff);
            checksumBuff = null;
          }
          startOffset = -1;
          checksum = null;
        }
      

      If there's an IOException occurred in dataIn.close(), then the slowReadBuff&checksumBuff could not be returned anymore. let's make a trivial change to reduce this risk.

      Attachments

        1. HDFS-4530.txt
          1 kB
          Liang Xie
        2. HDFS-4530-v2.txt
          0.6 kB
          Liang Xie
        3. HDFS-4530-v3.txt
          0.7 kB
          Liang Xie

        Issue Links

          Activity

            People

              xieliang007 Liang Xie
              xieliang007 Liang Xie
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: