brumi1024 commented on code in PR #6734:
URL: https://github.com/apache/hadoop/pull/6734#discussion_r1572651771


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/CGroupsHandler.java:
##########
@@ -36,17 +36,23 @@
 public interface CGroupsHandler {
 
   /**
-   * List of supported cgroup subsystem types.
+   * List of supported cgroup v1 and v2 subsystem types.
    */
   enum CGroupController {
-    CPU("cpu"),
+    // v1 specific
     NET_CLS("net_cls"),
     BLKIO("blkio"),
-    MEMORY("memory"),
     CPUACCT("cpuacct"),
-    CPUSET("cpuset"),
     FREEZER("freezer"),
-    DEVICES("devices");
+    DEVICES("devices"),
+
+    // v2 specific

Review Comment:
   This enum is used quite heavily in a map as a key, so to keep the changes as 
small as possible I avoided creating a new one. But I agree with the point that 
it's cleaner to separate the controllers (we cannot write invalid entries to 
the subtree_control files, as the FS won't allow the writes), at least that way 
we can avoid various IOExceptions. Edited the enum to contain two flags which 
denote which cgroup version each of the controllers belong to (there are a few 
ones which are valid in both V1 and V2), and updated the code accordingly. Now 
the getValidCgroups will return the version specific controllers.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to