APIdia Launch Partner
Top Description Fields Methods
jdk.internal.platform

public Interface CgroupSubsystemController

Known Direct Implementers
jdk.internal.platform.cgroupv1.CgroupV1SubsystemController, jdk.internal.platform.cgroupv2.CgroupV2SubsystemController
Imports
java.io.IOException, .UncheckedIOException, java.math.BigInteger, java.nio.file.Files, .Path, java.util.ArrayList, .List, .Optional, java.util.function.Function, java.util.stream.Stream

Cgroup version agnostic controller logic

Field Summary

Modifier and TypeField and Description
public static final String

Method Summary

Modifier and TypeMethod and Description
public static long

Returns:

The converted long value. "overflowRetval" is returned if the string representation exceeds the range of type long. "defaultRetval" is returned if another type of error occurred during conversion.
convertStringToLong
(String strval, long overflowRetval, long defaultRetval)

Convert a number from its string representation to a long.

public static double

Returns:

The double value or "defaultRetval" if there was an error.
getDoubleValue
(CgroupSubsystemController controller, String param, double defaultRetval)

Get a double value from file "param" within "controller".

public static long

Returns:

long value or "defaultRetval" if there was an error or no match was found.
getLongEntry
(CgroupSubsystemController controller, String param, String entryname, long defaultRetval)

getLongEntry Return the long value from the line containing the string "entryname" within file "param" in the "controller".

public static long

Returns:

The converted long value or "defaultRetval" if there was an error.
getLongValue
(CgroupSubsystemController controller, String param, Function<String, Long> conversion, long defaultRetval)

Get a long value from directory "controller" and file "param", by applying "conversion" to the string value within the file.

public static long

Returns:

The long value as derived by applying "conversion" to the matching line or "defaultRetval" if there was an error or no match found.
getLongValueMatchingLine
(CgroupSubsystemController controller, String param, String match, Function<String, Long> conversion, long defaultRetval)

Get an entry from file "param" within the "controller" directory path which matches string "match".

public static String

Returns:

Returns the contents of the file specified by param or null if an error occurs.
getStringValue
(CgroupSubsystemController controller, String param)

getStringValue Return the first line of the file "param" argument from the controller.

public String
path()

public static int[]

Returns:

int[] containing a sorted list of numbers as represented by the string range. Returns null if there was an error or the input was an empty string.
stringRangeToIntArray
(String range)

stringRangeToIntArray Convert a string in the form of 1,3-4,6 to an array of integers containing all the numbers in the range.

Field Detail

EMPTY_STRback to summary
public static final String EMPTY_STR

Method Detail

convertStringToLongback to summary
public static long convertStringToLong(String strval, long overflowRetval, long defaultRetval)

Convert a number from its string representation to a long.

Returns:long

The converted long value. "overflowRetval" is returned if the string representation exceeds the range of type long. "defaultRetval" is returned if another type of error occurred during conversion.

getDoubleValueback to summary
public static double getDoubleValue(CgroupSubsystemController controller, String param, double defaultRetval)

Get a double value from file "param" within "controller".

Returns:double

The double value or "defaultRetval" if there was an error.

getLongEntryback to summary
public static long getLongEntry(CgroupSubsystemController controller, String param, String entryname, long defaultRetval)

getLongEntry Return the long value from the line containing the string "entryname" within file "param" in the "controller".

Todo

Consider using weak references for caching BufferedReader object.

Returns:long

long value or "defaultRetval" if there was an error or no match was found.

getLongValueback to summary
public static long getLongValue(CgroupSubsystemController controller, String param, Function<String, Long> conversion, long defaultRetval)

Get a long value from directory "controller" and file "param", by applying "conversion" to the string value within the file.

Returns:long

The converted long value or "defaultRetval" if there was an error.

getLongValueMatchingLineback to summary
public static long getLongValueMatchingLine(CgroupSubsystemController controller, String param, String match, Function<String, Long> conversion, long defaultRetval)

Get an entry from file "param" within the "controller" directory path which matches string "match". Applies "conversion" to the matching line.

Returns:long

The long value as derived by applying "conversion" to the matching line or "defaultRetval" if there was an error or no match found.

getStringValueback to summary
public static String getStringValue(CgroupSubsystemController controller, String param)

getStringValue Return the first line of the file "param" argument from the controller.

Todo

Consider using weak references for caching BufferedReader object.

Returns:String

Returns the contents of the file specified by param or null if an error occurs.

pathback to summary
public String path()
stringRangeToIntArrayback to summary
public static int[] stringRangeToIntArray(String range)

stringRangeToIntArray Convert a string in the form of 1,3-4,6 to an array of integers containing all the numbers in the range.

Returns:int[]

int[] containing a sorted list of numbers as represented by the string range. Returns null if there was an error or the input was an empty string.