eolivelli commented on a change in pull request #14537:
URL: https://github.com/apache/pulsar/pull/14537#discussion_r817617264
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LinuxBrokerHostUsageImpl.java
##########
@@ -294,4 +302,8 @@ private double getTotalNicUsageTxKb(List<String> nics) {
private static long readLongFromFile(String path) throws IOException {
return Long.parseLong(new String(Files.readAllBytes(Paths.get(path)),
Charsets.UTF_8).trim());
}
+
+ private static double readDoubleFromPath(Path path) throws IOException {
+ return Double.parseDouble(new String(Files.readAllBytes(path)));
Review comment:
Double.parseDouble may throw a IllegalArgumentException
(NumberFormatExcepton)
we should wrap it in a IOException
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]