orc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dongjoon Hyun (JIRA)" <j...@apache.org>
Subject [jira] [Created] (ORC-301) `extractFileTail` should open a file in `try` statement
Date Wed, 14 Feb 2018 23:07:00 GMT
Dongjoon Hyun created ORC-301:
---------------------------------

             Summary: `extractFileTail` should open a file in `try` statement
                 Key: ORC-301
                 URL: https://issues.apache.org/jira/browse/ORC-301
             Project: ORC
          Issue Type: Bug
          Components: Java
    Affects Versions: 1.4.1
            Reporter: Dongjoon Hyun


To prevent opened file leakage, we need to move the file open position.

{code}
--- a/java/core/src/java/org/apache/orc/impl/ReaderImpl.java
       long maxFileLength) throws IOException {
-    FSDataInputStream file = fs.open(path);
+    FSDataInputStream file = null;
     ByteBuffer buffer;
     OrcProto.PostScript ps;
     OrcProto.FileTail.Builder fileTailBuilder = OrcProto.FileTail.newBuilder();
     long modificationTime;
     try {
+      file = fs.open(path);
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message