[ 
https://issues.apache.org/jira/browse/HADOOP-10792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14057795#comment-14057795
 ] 

Steve Loughran commented on HADOOP-10792:
-----------------------------------------

I think that {{newInstance}} method came in later, it is public so you are free 
to use it. The system property is there to turn it on even in code that doesn't 
use it.

In an instance of the filesystem which you have unique access to, you should 
call {{close()}} on it. It is your instance, after all


> Add FileSystem#closeIfNotReferred method
> ----------------------------------------
>
>                 Key: HADOOP-10792
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10792
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: fs
>            Reporter: Kousuke Saruta
>
> FileSystem#close closes FileSystem even if the same instance of FileSystem is 
> referred by someone.
> For instance, a library using FileSystem calls FileSystem.get, and a program 
> using the library calls FileSystem.get, both of instances of FileSystem is 
> same. 
> When the library and the program is implemented as different threads and one 
> calls FileSystem.close, another fails most of operations of FileSystem.
> So, we need the method like cloesIfNotReferred, which closes FileSystem only 
> if a instance of FileSystem is not referred by anyone.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to