hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hong Tang (JIRA)" <j...@apache.org>
Subject [jira] Created: (HADOOP-4673) IFile.Writer close() uses compressor after returning it to CodecPool.
Date Tue, 18 Nov 2008 00:27:44 GMT
 IFile.Writer close() uses compressor after returning it to CodecPool.
----------------------------------------------------------------------

                 Key: HADOOP-4673
                 URL: https://issues.apache.org/jira/browse/HADOOP-4673
             Project: Hadoop Core
          Issue Type: Bug
    Affects Versions: 0.18.2, 0.18.1
            Reporter: Hong Tang


The problem is of the same nature as HADOOP-4195.

The compression codec is returned to the CodecPool, and later is finished in "out.close()".

{code:title=IFile.java|borderStyle=solid}

    public void close() throws IOException {
      // Close the serializers
      keySerializer.close();
      valueSerializer.close();

      // Write EOF_MARKER for key/value length
      WritableUtils.writeVInt(out, EOF_MARKER);
      WritableUtils.writeVInt(out, EOF_MARKER);
      decompressedBytesWritten += 2 * WritableUtils.getVIntSize(EOF_MARKER);
      
      if (compressOutput) {
        // Flush data from buffers into the compressor
        out.flush();
        
        // Flush & return the compressor
        compressedOut.finish();
        compressedOut.resetState();
        CodecPool.returnCompressor(compressor);
        compressor = null;
      }

      // Close the stream
      rawOut.flush();
      compressedBytesWritten = rawOut.getPos() - start;

      // Close the underlying stream iff we own it...
      if (ownOutputStream) {
        out.close();
      }
      out = null;
    }

{code}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message