-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: linux control group version 2 API support cgroup v2
- Loading branch information
1 parent
1cdf1f8
commit 7e60a1c
Showing
9 changed files
with
284 additions
and
346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/main/java/com/aws/greengrass/util/platforms/unix/linux/CgroupSubSystem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.aws.greengrass.util.platforms.unix.linux; | ||
|
||
public enum CgroupSubSystem { | ||
Memory("memory", ""), CPU("cpu,cpuacct", ""), Freezer("freezer", "freezer"); | ||
|
||
private String osString; | ||
private String mountSrc; | ||
|
||
CgroupSubSystem(String osString, String mountSrc) { | ||
this.osString = osString; | ||
this.mountSrc = mountSrc; | ||
} | ||
|
||
/** | ||
* Get the osString associated with this CgroupSubController. | ||
* | ||
* @return the osString associated with this CgroupSubController. | ||
*/ | ||
public String getOsString() { | ||
return osString; | ||
} | ||
|
||
/** | ||
* Get the mountSrc associated with this CgroupSubController. | ||
* | ||
* @return the mountSrc associated with this CgroupSubController. | ||
*/ | ||
public String getMountSrc() { | ||
return mountSrc; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/main/java/com/aws/greengrass/util/platforms/unix/linux/CgroupSubSystemV2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.aws.greengrass.util.platforms.unix.linux; | ||
|
||
public enum CgroupSubSystemV2 { | ||
Memory("", ""), CPU("", ""), Freezer("", ""), | ||
Unified("",""); | ||
|
||
private String osString; | ||
private String mountSrc; | ||
|
||
CgroupSubSystemV2(String osString, String mountSrc) { | ||
this.osString = osString; | ||
this.mountSrc = mountSrc; | ||
} | ||
|
||
/** | ||
* Get the osString associated with this CgroupSubController. | ||
* | ||
* @return the osString associated with this CgroupSubController. | ||
*/ | ||
public String getOsString() { | ||
return osString; | ||
} | ||
|
||
/** | ||
* Get the mountSrc associated with this CgroupSubController. | ||
* | ||
* @return the mountSrc associated with this CgroupSubController. | ||
*/ | ||
public String getMountSrc() { | ||
return mountSrc; | ||
} | ||
} |
74 changes: 0 additions & 74 deletions
74
src/main/java/com/aws/greengrass/util/platforms/unix/linux/CgroupV2.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.