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] Issue Comment Edited: (HADOOP-4655) FileSystem.CACHE should be ref-counted
Date Sun, 23 Nov 2008 00:17:44 GMT

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

hong.tang edited comment on HADOOP-4655 at 11/22/08 4:16 PM:
-------------------------------------------------------------

I have a better idea to fix the current problem with minimum change of the API:

- Make FileSystem.CACHE ref-counted.
- FileSystem.close() is no-op, and knows nothing about FileSystem.CACHE.
- Add two static methods whose names clearly reflect the shared nature of the FileSystem objects:
    - static FileSystem getFileSystem(Path, Configuration)
    - static void returnFileSystem(FileSystem)
- Deprecate Path.getFileSystem(Configuration), and suggest to use FileSystem.getFileSystem
instead.

The recommended usage pattern would be:
- If a FileSystem object is created by new, then people should release resources by FileSystem.close().
- If a FileSystem object is obtained by getFileSystem, then the resource should be released
through returnFileSystem.



      was (Author: hong.tang):
    I have a better idea to fix the current problem with minimum change of the API:

- Make FileSystem.CACHE ref-counted.
- FileSystem.close() is no-op, and knows nothing about FileSystem.CACHE.
- Add two static methods whose names clearly reflect the shared nature of the FileSystem objects:
    - static FileSystem getFileSystem(Path, Configuration)
    - static void returnFileSystem(FileSystem)
- Deprecate Path.getFileSystem(Configuration), and suggest to use FileSystem.borrowFileSystem
instead.

The recommended usage pattern would be:
- If a FileSystem object is created by new, then people should release resources by FileSystem.close().
- If a FileSystem object is obtained by getFileSystem, then the resource should be released
through returnFileSystem.


  
> FileSystem.CACHE should be ref-counted
> --------------------------------------
>
>                 Key: HADOOP-4655
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4655
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs, fs
>    Affects Versions: 0.18.1, 0.18.2, 0.19.0, 0.19.1, 0.20.0
>            Reporter: Hong Tang
>
> FileSystem.CACHE is not ref-counted, and could lead to resource leakage.

-- 
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