Class CgroupCommon
- java.lang.Object
-
- org.apache.storm.container.cgroup.CgroupCommon
-
- All Implemented Interfaces:
CgroupCommonOperation
public class CgroupCommon extends Object implements CgroupCommonOperation
-
-
Field Summary
Fields Modifier and Type Field Description static StringCGROUP_CLONE_CHILDRENstatic StringCGROUP_EVENT_CONTROLstatic StringCGROUP_PROCSstatic StringNOTIFY_ON_RELEASEstatic StringRELEASE_AGENTstatic StringTASKS
-
Constructor Summary
Constructors Constructor Description CgroupCommon(String name, Hierarchy hierarchy, CgroupCommon parent)CgroupCommon(Hierarchy hierarchy, String dir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProcs(int pid)add a process to cgroup.voidaddTask(int taskId)add task to cgroup.voiddelete()booleanequals(Object o)booleangetCgroupCloneChildren()get the cgroup.clone_children config.Set<CgroupCommon>getChildren()Map<SubSystemType,CgroupCore>getCores()StringgetDir()HierarchygetHierarchy()StringgetName()booleangetNotifyOnRelease()to get the notify_on_release config.CgroupCommongetParent()Set<Long>getPids()get the PIDs of processes running in cgroup.StringgetReleaseAgent()get the command for the relase agent to execute.Set<Integer>getTasks()Get a list of task ids running in CGroup.inthashCode()booleanisRoot()voidsetCgroupCloneChildren(boolean flag)Set the cgroup.clone_children config.voidsetEventControl(String eventFd, String controlFd, String... args)set event control config.voidsetNotifyOnRelease(boolean flag)to set notify_on_release config in cgroup.voidsetReleaseAgent(String command)set a command for the release agent to execute.StringtoString()
-
-
-
Field Detail
-
TASKS
public static final String TASKS
- See Also:
- Constant Field Values
-
NOTIFY_ON_RELEASE
public static final String NOTIFY_ON_RELEASE
- See Also:
- Constant Field Values
-
RELEASE_AGENT
public static final String RELEASE_AGENT
- See Also:
- Constant Field Values
-
CGROUP_CLONE_CHILDREN
public static final String CGROUP_CLONE_CHILDREN
- See Also:
- Constant Field Values
-
CGROUP_EVENT_CONTROL
public static final String CGROUP_EVENT_CONTROL
- See Also:
- Constant Field Values
-
CGROUP_PROCS
public static final String CGROUP_PROCS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CgroupCommon
public CgroupCommon(String name, Hierarchy hierarchy, CgroupCommon parent)
-
-
Method Detail
-
addTask
public void addTask(int taskId) throws IOExceptionDescription copied from interface:CgroupCommonOperationadd task to cgroup.- Specified by:
addTaskin interfaceCgroupCommonOperation- Parameters:
taskId- task id of task to add- Throws:
IOException
-
getTasks
public Set<Integer> getTasks() throws IOException
Description copied from interface:CgroupCommonOperationGet a list of task ids running in CGroup.- Specified by:
getTasksin interfaceCgroupCommonOperation- Throws:
IOException
-
addProcs
public void addProcs(int pid) throws IOExceptionDescription copied from interface:CgroupCommonOperationadd a process to cgroup.- Specified by:
addProcsin interfaceCgroupCommonOperation- Parameters:
pid- the PID of the process to add- Throws:
IOException
-
getPids
public Set<Long> getPids() throws IOException
Description copied from interface:CgroupCommonOperationget the PIDs of processes running in cgroup.- Specified by:
getPidsin interfaceCgroupCommonOperation- Throws:
IOException
-
getNotifyOnRelease
public boolean getNotifyOnRelease() throws IOExceptionDescription copied from interface:CgroupCommonOperationto get the notify_on_release config.- Specified by:
getNotifyOnReleasein interfaceCgroupCommonOperation- Throws:
IOException
-
setNotifyOnRelease
public void setNotifyOnRelease(boolean flag) throws IOExceptionDescription copied from interface:CgroupCommonOperationto set notify_on_release config in cgroup.- Specified by:
setNotifyOnReleasein interfaceCgroupCommonOperation- Throws:
IOException
-
getReleaseAgent
public String getReleaseAgent() throws IOException
Description copied from interface:CgroupCommonOperationget the command for the relase agent to execute.- Specified by:
getReleaseAgentin interfaceCgroupCommonOperation- Throws:
IOException
-
setReleaseAgent
public void setReleaseAgent(String command) throws IOException
Description copied from interface:CgroupCommonOperationset a command for the release agent to execute.- Specified by:
setReleaseAgentin interfaceCgroupCommonOperation- Throws:
IOException
-
getCgroupCloneChildren
public boolean getCgroupCloneChildren() throws IOExceptionDescription copied from interface:CgroupCommonOperationget the cgroup.clone_children config.- Specified by:
getCgroupCloneChildrenin interfaceCgroupCommonOperation- Throws:
IOException
-
setCgroupCloneChildren
public void setCgroupCloneChildren(boolean flag) throws IOExceptionDescription copied from interface:CgroupCommonOperationSet the cgroup.clone_children config.- Specified by:
setCgroupCloneChildrenin interfaceCgroupCommonOperation- Throws:
IOException
-
setEventControl
public void setEventControl(String eventFd, String controlFd, String... args) throws IOException
Description copied from interface:CgroupCommonOperationset event control config.- Specified by:
setEventControlin interfaceCgroupCommonOperation- Throws:
IOException
-
getHierarchy
public Hierarchy getHierarchy()
-
getName
public String getName()
-
getDir
public String getDir()
-
getParent
public CgroupCommon getParent()
-
getChildren
public Set<CgroupCommon> getChildren()
-
isRoot
public boolean isRoot()
-
getCores
public Map<SubSystemType,CgroupCore> getCores()
-
delete
public void delete() throws IOException- Throws:
IOException
-
-