Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-15226 Über-JIRA: S3Guard Phase III: Hadoop 3.2 features
  3. HADOOP-15423

Merge fileCache and dirCache into one single cache in LocalMetadataStore

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.0
    • Component/s: None
    • Labels:
      None

      Description

      Right now the s3guard.LocalMetadataStore uses two HashMap in the implementation - one for the file and one for the dir hash.

        /** Contains directories and files. */
        private Cache<Path, PathMetadata> fileCache;
      
        /** Contains directory listings. */
        private Cache<Path, DirListingMetadata> dirCache;
      

      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:

        static class LocalMetaEntry {
          @Nullable
          public PathMetadata pathMetadata;
          @Nullable
          public DirListingMetadata dirListingMetadata;
        }
      

      or a Pair (tuple):

      Pair<PathMetadata, DirListingMetadata> metaEntry;
      

      And only one hash/cache for these elements.

        Attachments

        1. HADOOP-15423.001.patch
          23 kB
          Gabor Bota

          Issue Links

            Activity

              People

              • Assignee:
                gabor.bota Gabor Bota
                Reporter:
                gabor.bota Gabor Bota
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: