hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andras Bokor (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-7330) Unclosed RandomAccessFile warnings in FSDatasetIml.
Date Mon, 25 Apr 2016 11:43:12 GMT

    [ https://issues.apache.org/jira/browse/HDFS-7330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15256240#comment-15256240

Andras Bokor commented on HDFS-7330:

I do not see these warnings. The assumption is true btw, so the underling RandomAccessFile
gets closed once the Inputstream is closed. See the following small PoC:

    RandomAccessFile fis1 = new RandomAccessFile(new File("/tmp/test.log"),"r");
        FileInputStream fis2 = new FileInputStream(fis1.getFD());
        System.out.println("Read fis1...");

Read fis1...
Exception in thread "main" java.io.IOException: Stream Closed
	at java.io.RandomAccessFile.read0(Native Method)
	at java.io.RandomAccessFile.read(RandomAccessFile.java:330)
	at Main.main(Main.java:13)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

Process finished with exit code 1

Where do you see the warnings?

> Unclosed RandomAccessFile warnings in FSDatasetIml.
> ---------------------------------------------------
>                 Key: HDFS-7330
>                 URL: https://issues.apache.org/jira/browse/HDFS-7330
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: datanode
>    Affects Versions: 2.5.1
>            Reporter: Konstantin Shvachko
>            Assignee: Milan Desai
>              Labels: newbie
> RandomAccessFile is opened as an underline file for FileInputStream. It should be closed
when the stream is closed. So to fix these 2 warning (in getBlockInputStream() and getTmpInputStreams())
we just need suppress them.

This message was sent by Atlassian JIRA

View raw message