kkhatua commented on a change in pull request #1437: DRILL-6702: Disable CPU 
Reporting for non-HotSpot JDKs
URL: https://github.com/apache/drill/pull/1437#discussion_r212789862
 
 

 ##########
 File path: common/src/main/java/org/apache/drill/exec/metrics/CpuGaugeSet.java
 ##########
 @@ -32,13 +32,20 @@
  */
 @SuppressWarnings("restriction")
 public class CpuGaugeSet implements MetricSet {
+  private static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(CpuGaugeSet.class);
 
-  private OperatingSystemMXBean osMXBean;
-  private RuntimeMXBean rtMXBean;
+  private final OperatingSystemMXBean osMXBean;
+  private final RuntimeMXBean rtMXBean;
 
   public CpuGaugeSet() {
-    this.osMXBean = (OperatingSystemMXBean) 
ManagementFactory.getOperatingSystemMXBean();
     this.rtMXBean = ManagementFactory.getRuntimeMXBean();
+    //DRILL-6702: Instead of worrying about compiling with IBM JDK, for now, 
we shall provide no CPU metrics for non-HotSpot JVMs
+    if (System.getProperty("java.vm.name").contains("HotSpot")) {
 
 Review comment:
   Ok. I'm not able to repro the ClassCastException with the IBM JDK running an 
Oracle compilation. 
   The IBM JDK on my Linux box is using 
`com.ibm.lang.management.internal.UnixExtendedOperatingSystem` which implements 
the `com.sun.management.OperatingSystemMXBean` interface. The JIRA reports a 
class cast exception from `com.ibm.lang.management.ExtendedOperatingSystem`. 
So, it might be an issue with the platform's implementation. 
   I'll make the change however, and see if the original JIRA filer can confirm 
the fix.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to