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
CgroupCommonOperationadd task to cgroup.
addTask in interface CgroupCommonOperationtaskId - task id of task to addIOExceptionpublic Set<Integer> getTasks() throws IOException
CgroupCommonOperationGet a list of task ids running in CGroup.
getTasks in interface CgroupCommonOperationIOExceptionpublic void addProcs(int pid)
throws IOException
CgroupCommonOperationadd a process to cgroup.
addProcs in interface CgroupCommonOperationpid - the PID of the process to addIOExceptionpublic Set<Long> getPids() throws IOException
CgroupCommonOperationget the PIDs of processes running in cgroup.
getPids in interface CgroupCommonOperationIOExceptionpublic boolean getNotifyOnRelease()
throws IOException
CgroupCommonOperationto get the notify_on_release config.
getNotifyOnRelease in interface CgroupCommonOperationIOExceptionpublic void setNotifyOnRelease(boolean flag)
throws IOException
CgroupCommonOperationto set notify_on_release config in cgroup.
setNotifyOnRelease in interface CgroupCommonOperationIOExceptionpublic String getReleaseAgent() throws IOException
CgroupCommonOperationget the command for the relase agent to execute.
getReleaseAgent in interface CgroupCommonOperationIOExceptionpublic void setReleaseAgent(String command) throws IOException
CgroupCommonOperationset a command for the release agent to execute.
setReleaseAgent in interface CgroupCommonOperationIOExceptionpublic boolean getCgroupCloneChildren()
throws IOException
CgroupCommonOperationget the cgroup.clone_children config.
getCgroupCloneChildren in interface CgroupCommonOperationIOExceptionpublic void setCgroupCloneChildren(boolean flag)
throws IOException
CgroupCommonOperationSet the cgroup.clone_children config.
setCgroupCloneChildren in interface CgroupCommonOperationIOExceptionpublic void setEventControl(String eventFd, String controlFd, String... args) throws IOException
CgroupCommonOperationset event control config.
setEventControl in interface CgroupCommonOperationIOExceptionpublic 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
IOExceptionCopyright © 2021 The Apache Software Foundation. All rights reserved.