Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-9098

Separate mtab file reader code and cgroups file system hierarchy parser code from CGroupsHandlerImpl and ResourceHandlerModule

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Separate mtab file reader code and cgroups file system hierarchy parser code from CGroupsHandlerImpl and ResourceHandlerModule

      CGroupsHandlerImpl has a method parseMtab that parses an mtab file and stores cgroups data.
      CGroupsLCEResourcesHandler also has a method with the same name, with identical code.
      The parser code should be extracted from these places and be added in a new class as this is a separate responsibility.
      As the output of the file parser is a Map<String, Set<String>>, it's better to encapsulate it in a domain object, named 'CGroupsMountConfig' for instance.

      ResourceHandlerModule has a method named parseConfiguredCGroupPath, that is responsible for producing the same results (Map<String, Set<String>>) to store cgroups data, it does not operate on mtab file, but looking at the filesystem for cgroup settings. As the output is the same, CGroupsMountConfig should be used here, too.
      Again, this could should not be part of ResourceHandlerModule as it is a different responsibility.

      One more thing which is strongly related to the methods above is CGroupsHandlerImpl.initializeFromMountConfig: This method processes the result of a parsed mtab file or a parsed cgroups filesystem data and stores file system paths for all available controllers. This method invokes findControllerPathInMountConfig, which is a duplicated in CGroupsHandlerImpl and CGroupsLCEResourcesHandler, so it should be moved to a single place. To store filesystem path and controller mappings, a new domain object could be introduced.

      Attachments

        1. YARN-9098.008.patch
          74 kB
          Szilard Nemeth
        2. YARN-9098.008.patch
          74 kB
          Szilard Nemeth
        3. YARN-9098.007.patch
          74 kB
          Szilard Nemeth
        4. YARN-9098.006.patch
          72 kB
          Szilard Nemeth
        5. YARN-9098.005.patch
          55 kB
          Szilard Nemeth
        6. YARN-9098.004.patch
          54 kB
          Szilard Nemeth
        7. YARN-9098.003.patch
          52 kB
          Szilard Nemeth
        8. YARN-9098.002.patch
          51 kB
          Szilard Nemeth

        Activity

          People

            shuzirra Gergely Pollák
            snemeth Szilard Nemeth
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: