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

Colin Patrick McCabe commented on HADOOP-6356:
----------------------------------------------

I think the performance situation may not be as bad as you think.  HDFS caches 
things like sockets and short-circuit file descriptors in a separate, global 
cache that is not per-{{FileContext}}.  They are cached in 
{{org.apache.hadoop.hdfs.ClientContext}} and will be shared between multiple 
different {{FileContext}} objects.

The big problems with caching {{FileContext}} objects are:
* they're mutable, so you don't know when another thread will call 
{{FileContext#setWorkingDirectory}} and screw up how your thread is resolving 
relative paths
* UGI has to be a part of the "lookup key" for any cache, and we have refused 
to compare UGIs except by object equality in the past.  This can lead to (for 
some) counter-intuitive cache behavior.

Given these limitations, I think it's better to have the applications do their 
own caching.  Maybe we could provide a utility class that would help with this, 
but we should stay away from adding more global variables.

> Add a Cache for AbstractFileSystem in the new FileContext/AbstractFileSystem 
> framework.
> ---------------------------------------------------------------------------------------
>
>                 Key: HADOOP-6356
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6356
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: fs
>    Affects Versions: 0.22.0
>            Reporter: Sanjay Radia
>            Assignee: Sanjay Radia
>
> The new filesystem framework, FileContext and AbstractFileSystem does not 
> implement a cache for AbstractFileSystem.
> This Jira proposes to add a cache to the new framework just like with the old 
> FileSystem.



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

Reply via email to