[
https://issues.apache.org/jira/browse/HDFS-7693?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14297456#comment-14297456
]
Chris Nauroth commented on HDFS-7693:
-------------------------------------
Hi Colin. I've only taken a quick scan of the patch so far. Can you please
describe the motivation for this feature? Is this intended to optimize a
particular usage pattern that you're seeing?
Since the cache manipulation methods are in the public header, it appears it
will be the caller's responsibility to allocate and use a cache. Did you
consider trying to encapsulate the cache completely behind the existing API?
The presence of mutexes implies that you intend for the cache to be called from
multiple threads. I also see that LRU eviction can trigger a close of the file
by side effect. I didn't see any reference counting, so is there a risk that
one thread triggers eviction and close of a stream that another thread is still
using?
Again, maybe some of this would be clearer if I first understood the intended
use case.
I can volunteer to take the patch for a spin on Windows too. I can see right
away that test_libhdfs_cache.c is likely to fail compilation, because the
Microsoft C compiler doesn't support designated initializers on structs.
Thanks!
> libhdfs: add hdfsFile cache
> ---------------------------
>
> Key: HDFS-7693
> URL: https://issues.apache.org/jira/browse/HDFS-7693
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: libhdfs
> Affects Versions: 2.7.0
> Reporter: Colin Patrick McCabe
> Assignee: Colin Patrick McCabe
> Attachments: HDFS-7693.001.patch
>
>
> Add an hdfsFile cache inside libhdfs.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)