All Known Implementing Classes:
AbstractCGroupsHandler

@Private @Unstable public interface CGroupsHandler
Provides CGroups functionality. Implementations are expected to be thread-safe
  • Field Details

  • Method Details

    • initializeCGroupController

      void initializeCGroupController(CGroupsHandler.CGroupController controller) throws ResourceHandlerException
      Mounts or initializes a cgroup controller.
      Parameters:
      controller - - the controller being initialized
      Throws:
      ResourceHandlerException - the initialization failed due to the environment
    • createCGroup

      String createCGroup(CGroupsHandler.CGroupController controller, String cGroupId) throws ResourceHandlerException
      Creates a cgroup for a given controller.
      Parameters:
      controller - - controller type for which the cgroup is being created
      cGroupId - - id of the cgroup being created
      Returns:
      full path to created cgroup
      Throws:
      ResourceHandlerException - creation failed
    • deleteCGroup

      void deleteCGroup(CGroupsHandler.CGroupController controller, String cGroupId) throws ResourceHandlerException
      Deletes the specified cgroup.
      Parameters:
      controller - - controller type for the cgroup
      cGroupId - - id of the cgroup being deleted
      Throws:
      ResourceHandlerException - deletion failed
    • getControllerPath

      String getControllerPath(CGroupsHandler.CGroupController controller)
      Gets the absolute path to the specified cgroup controller.
      Parameters:
      controller - - controller type for the cgroup
      Returns:
      the root of the controller.
    • getValidCGroups

      Set<String> getValidCGroups()
      Gets the valid cgroup controller names based on the version used.
      Returns:
      a set containing the valid controller names for the used cgroup version.
    • getRelativePathForCGroup

      String getRelativePathForCGroup(String cGroupId)
      Gets the relative path for the cgroup, independent of a controller, for a given cgroup id.
      Parameters:
      cGroupId - - id of the cgroup
      Returns:
      path for the cgroup relative to the root of (any) controller.
    • getPathForCGroup

      String getPathForCGroup(CGroupsHandler.CGroupController controller, String cGroupId)
      Gets the full path for the cgroup, given a controller and a cgroup id.
      Parameters:
      controller - - controller type for the cgroup
      cGroupId - - id of the cgroup
      Returns:
      full path for the cgroup
    • getPathForCGroupTasks

      String getPathForCGroupTasks(CGroupsHandler.CGroupController controller, String cGroupId)
      Gets the full path for the cgroup's tasks file, given a controller and a cgroup id.
      Parameters:
      controller - - controller type for the cgroup
      cGroupId - - id of the cgroup
      Returns:
      full path for the cgroup's tasks file
    • getPathForCGroupParam

      String getPathForCGroupParam(CGroupsHandler.CGroupController controller, String cGroupId, String param)
      Gets the full path for a cgroup parameter, given a controller, cgroup id and parameter name.
      Parameters:
      controller - - controller type for the cgroup
      cGroupId - - id of the cgroup
      param - - cgroup parameter ( e.g classid )
      Returns:
      full path for the cgroup parameter
    • updateCGroupParam

      void updateCGroupParam(CGroupsHandler.CGroupController controller, String cGroupId, String param, String value) throws ResourceHandlerException
      updates a cgroup parameter, given a controller, cgroup id, parameter name. and a parameter value
      Parameters:
      controller - - controller type for the cgroup
      cGroupId - - id of the cgroup
      param - - cgroup parameter ( e.g classid )
      value - - value to be written to the parameter file
      Throws:
      ResourceHandlerException - the operation failed
    • getCGroupParam

      String getCGroupParam(CGroupsHandler.CGroupController controller, String cGroupId, String param) throws ResourceHandlerException
      reads a cgroup parameter value, given a controller, cgroup id, parameter. name
      Parameters:
      controller - - controller type for the cgroup
      cGroupId - - id of the cgroup
      param - - cgroup parameter ( e.g classid )
      Returns:
      parameter value as read from the parameter file
      Throws:
      ResourceHandlerException - the operation failed
    • getCGroupMountPath

      String getCGroupMountPath()
      Returns CGroup Mount Path.
      Returns:
      parameter value as read from the parameter file
    • getCGroupV2MountPath

      String getCGroupV2MountPath()
      Returns CGroupV2 Mount Path.
      Returns:
      parameter value as read from the parameter file