public class CgroupCommon extends Object implements CgroupCommonOperation
Modifier and Type | Field and Description |
---|---|
static String |
CGROUP_CLONE_CHILDREN |
static String |
CGROUP_EVENT_CONTROL |
static String |
CGROUP_PROCS |
static String |
NOTIFY_ON_RELEASE |
static String |
RELEASE_AGENT |
static String |
TASKS |
Constructor and Description |
---|
CgroupCommon(Hierarchy hierarchy,
String dir) |
CgroupCommon(String name,
Hierarchy hierarchy,
CgroupCommon parent) |
Modifier and Type | Method and Description |
---|---|
void |
addProcs(int pid)
add a process to cgroup.
|
void |
addTask(int taskId)
add task to cgroup.
|
void |
delete() |
boolean |
equals(Object o) |
boolean |
getCgroupCloneChildren()
get the cgroup.clone_children config.
|
Set<CgroupCommon> |
getChildren() |
Map<SubSystemType,CgroupCore> |
getCores() |
String |
getDir() |
Hierarchy |
getHierarchy() |
String |
getName() |
boolean |
getNotifyOnRelease()
to get the notify_on_release config.
|
CgroupCommon |
getParent() |
Set<Long> |
getPids()
get the PIDs of processes running in cgroup.
|
String |
getReleaseAgent()
get the command for the relase agent to execute.
|
Set<Integer> |
getTasks()
Get a list of task ids running in CGroup.
|
int |
hashCode() |
boolean |
isRoot() |
void |
setCgroupCloneChildren(boolean flag)
Set the cgroup.clone_children config.
|
void |
setEventControl(String eventFd,
String controlFd,
String... args)
set event control config.
|
void |
setNotifyOnRelease(boolean flag)
to set notify_on_release config in cgroup.
|
void |
setReleaseAgent(String command)
set a command for the release agent to execute.
|
String |
toString() |
public static final String TASKS
public static final String NOTIFY_ON_RELEASE
public static final String RELEASE_AGENT
public static final String CGROUP_CLONE_CHILDREN
public static final String CGROUP_EVENT_CONTROL
public static final String CGROUP_PROCS
public CgroupCommon(String name, Hierarchy hierarchy, CgroupCommon parent)
public void addTask(int taskId) throws IOException
CgroupCommonOperation
add task to cgroup.
addTask
in interface CgroupCommonOperation
taskId
- task id of task to addIOException
public Set<Integer> getTasks() throws IOException
CgroupCommonOperation
Get a list of task ids running in CGroup.
getTasks
in interface CgroupCommonOperation
IOException
public void addProcs(int pid) throws IOException
CgroupCommonOperation
add a process to cgroup.
addProcs
in interface CgroupCommonOperation
pid
- the PID of the process to addIOException
public Set<Long> getPids() throws IOException
CgroupCommonOperation
get the PIDs of processes running in cgroup.
getPids
in interface CgroupCommonOperation
IOException
public boolean getNotifyOnRelease() throws IOException
CgroupCommonOperation
to get the notify_on_release config.
getNotifyOnRelease
in interface CgroupCommonOperation
IOException
public void setNotifyOnRelease(boolean flag) throws IOException
CgroupCommonOperation
to set notify_on_release config in cgroup.
setNotifyOnRelease
in interface CgroupCommonOperation
IOException
public String getReleaseAgent() throws IOException
CgroupCommonOperation
get the command for the relase agent to execute.
getReleaseAgent
in interface CgroupCommonOperation
IOException
public void setReleaseAgent(String command) throws IOException
CgroupCommonOperation
set a command for the release agent to execute.
setReleaseAgent
in interface CgroupCommonOperation
IOException
public boolean getCgroupCloneChildren() throws IOException
CgroupCommonOperation
get the cgroup.clone_children config.
getCgroupCloneChildren
in interface CgroupCommonOperation
IOException
public void setCgroupCloneChildren(boolean flag) throws IOException
CgroupCommonOperation
Set the cgroup.clone_children config.
setCgroupCloneChildren
in interface CgroupCommonOperation
IOException
public void setEventControl(String eventFd, String controlFd, String... args) throws IOException
CgroupCommonOperation
set event control config.
setEventControl
in interface CgroupCommonOperation
IOException
public Hierarchy getHierarchy()
public String getName()
public String getDir()
public CgroupCommon getParent()
public Set<CgroupCommon> getChildren()
public boolean isRoot()
public Map<SubSystemType,CgroupCore> getCores()
public void delete() throws IOException
IOException
Copyright © 2020 The Apache Software Foundation. All rights reserved.