Class CgroupCenter
- java.lang.Object
-
- org.apache.storm.container.cgroup.CgroupCenter
-
- All Implemented Interfaces:
CgroupOperation
public class CgroupCenter extends Object implements CgroupOperation
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createCgroup(CgroupCommon cgroup)
create a cgroup.void
deleteCgroup(CgroupCommon cgroup)
delete a cgroup.List<Hierarchy>
getHierarchies()
Get a list of hierarchies.Hierarchy
getHierarchyWithSubSystem(SubSystemType subSystem)
get the first hierarchy that has a certain subsystem isMounted.Hierarchy
getHierarchyWithSubSystems(List<SubSystemType> subSystems)
get the first hierarchy that has a certain list of subsystems isMounted.static CgroupCenter
getInstance()
Set<SubSystem>
getSubSystems()
get a list of available subsystems.boolean
isMounted(Hierarchy hierarchy)
check if a hiearchy is mounted.boolean
isSubSystemEnabled(SubSystemType subSystemType)
Check if a subsystem is enabled.void
mount(Hierarchy hierarchy)
mount a hierarchy.void
umount(Hierarchy hierarchy)
umount a heirarchy.
-
-
-
Method Detail
-
getInstance
public static CgroupCenter getInstance()
-
getHierarchies
public List<Hierarchy> getHierarchies()
Description copied from interface:CgroupOperation
Get a list of hierarchies.- Specified by:
getHierarchies
in interfaceCgroupOperation
-
getSubSystems
public Set<SubSystem> getSubSystems()
Description copied from interface:CgroupOperation
get a list of available subsystems.- Specified by:
getSubSystems
in interfaceCgroupOperation
-
isSubSystemEnabled
public boolean isSubSystemEnabled(SubSystemType subSystemType)
Description copied from interface:CgroupOperation
Check if a subsystem is enabled.- Specified by:
isSubSystemEnabled
in interfaceCgroupOperation
-
getHierarchyWithSubSystem
public Hierarchy getHierarchyWithSubSystem(SubSystemType subSystem)
Description copied from interface:CgroupOperation
get the first hierarchy that has a certain subsystem isMounted.- Specified by:
getHierarchyWithSubSystem
in interfaceCgroupOperation
-
getHierarchyWithSubSystems
public Hierarchy getHierarchyWithSubSystems(List<SubSystemType> subSystems)
Description copied from interface:CgroupOperation
get the first hierarchy that has a certain list of subsystems isMounted.- Specified by:
getHierarchyWithSubSystems
in interfaceCgroupOperation
-
isMounted
public boolean isMounted(Hierarchy hierarchy)
Description copied from interface:CgroupOperation
check if a hiearchy is mounted.- Specified by:
isMounted
in interfaceCgroupOperation
-
mount
public void mount(Hierarchy hierarchy) throws IOException
Description copied from interface:CgroupOperation
mount a hierarchy.- Specified by:
mount
in interfaceCgroupOperation
- Throws:
IOException
-
umount
public void umount(Hierarchy hierarchy) throws IOException
Description copied from interface:CgroupOperation
umount a heirarchy.- Specified by:
umount
in interfaceCgroupOperation
- Throws:
IOException
-
createCgroup
public void createCgroup(CgroupCommon cgroup) throws SecurityException
Description copied from interface:CgroupOperation
create a cgroup.- Specified by:
createCgroup
in interfaceCgroupOperation
- Throws:
SecurityException
-
deleteCgroup
public void deleteCgroup(CgroupCommon cgroup) throws IOException
Description copied from interface:CgroupOperation
delete a cgroup.- Specified by:
deleteCgroup
in interfaceCgroupOperation
- Throws:
IOException
-
-