RFR: 8226575: OperatingSystemMXBean should be made container aware
Mandy Chung
mandy.chung at oracle.com
Tue Dec 10 06:11:59 UTC 2019
On 12/9/19 3:47 PM, Daniil Titov wrote:
> Hi Mandy and Bob,
>
> Please review a new version of the webrev [1] that moves doPrivileged calls in
> jdk.internal.platform.cgroupv1.SubSystem to separate methods that throw
> IOException, as Mandy suggested.
>
> Mach5 tests are still running.
>
>
> [1] Webrev: http://cr.openjdk.java.net/~dtitov/8226575/webrev.06/
I reviewed Metrics and Subsystem in this version.
I think it's simpler to have unwrapIOExceptionAndRethrow handling the
InternalError case.
+ List<String> lines = subsystem.readMatchingLines(param);
+ for (String line : lines) {
if (line.startsWith(match)) {
retval = conversion.apply(line);
break;
}
}This can simply call Metrics::readFilePrivileged and process on the
Stream<String>. return Metrics::readFilePrivileged(Paths.get(subsystem.path(), param))
.filter(line -> line.startsWith(match))
.map(conversion::apply)
.findFirst().orElseGet(() ->retval);
I don't need to see a new webrev.
Mandy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20191209/e22a6f49/attachment.htm>
More information about the serviceability-dev
mailing list