You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@orc.apache.org by "Prasanth Jayachandran (JIRA)" <ji...@apache.org> on 2018/02/16 03:21:00 UTC

[jira] [Resolved] (ORC-301) `extractFileTail` should open a file in `try` statement

     [ https://issues.apache.org/jira/browse/ORC-301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Prasanth Jayachandran resolved ORC-301.
---------------------------------------
       Resolution: Fixed
         Assignee: Dongjoon Hyun
    Fix Version/s: 1.5.0
                   1.4.4

Committed to master and branch-1.4. Thanks [~dongjoon] for your contribution!

> `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
>            Assignee: Dongjoon Hyun
>            Priority: Major
>             Fix For: 1.4.4, 1.5.0
>
>
> 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)