[
https://issues.apache.org/jira/browse/HADOOP-15423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16521005#comment-16521005
]
Gabor Bota commented on HADOOP-15423:
-------------------------------------
{{DirListingMetadata}} is for storing directory listings, and {{FileMetadata}}
is for storing stuff like permissions and last modified date.
I think this information can be stored in the same place (in the same
instance). I think of {{FileMetadata}} more like a file descriptor, and
{{DirListingMetadata}} more like just a listing. Also {{FileMetadata}} has an
{{isDir}} field to mark it if it's a directory.
I think storing both in the same record is not an impossibility, because if we
only store the {{DirListingMetadata}} we won't know anything about the
information that only {{FileMetadata}} has.
> Merge fileCache and dirCache into one single cache in LocalMetadataStore
> ------------------------------------------------------------------------
>
> Key: HADOOP-15423
> URL: https://issues.apache.org/jira/browse/HADOOP-15423
> Project: Hadoop Common
> Issue Type: Sub-task
> Reporter: Gabor Bota
> Assignee: Gabor Bota
> Priority: Minor
> Attachments: HADOOP-15423.001.patch
>
>
> Right now the s3guard.LocalMetadataStore uses two HashMap in the
> implementation - one for the file and one for the dir hash.
> {code:java}
> /** Contains directories and files. */
> private Cache<Path, PathMetadata> fileCache;
> /** Contains directory listings. */
> private Cache<Path, DirListingMetadata> dirCache;
> {code}
> It would be nice to have only one hash instead of these two for storing the
> values. An idea for the implementation would be to have a class with nullable
> fields:
> {code:java}
> static class LocalMetaEntry {
> @Nullable
> public PathMetadata pathMetadata;
> @Nullable
> public DirListingMetadata dirListingMetadata;
> }
> {code}
> or a Pair (tuple):
> {code:java}
> Pair<PathMetadata, DirListingMetadata> metaEntry;
> {code}
> And only one hash/cache for these elements.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]