zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject svn commit: r1612359 - in /zookeeper/trunk: CHANGES.txt src/java/main/org/apache/zookeeper/server/admin/Commands.java
Date Mon, 21 Jul 2014 17:58:36 GMT
Author: phunt
Date: Mon Jul 21 17:58:36 2014
New Revision: 1612359

URL: http://svn.apache.org/r1612359
Log:
ZOOKEEPER-1973. Jetty Server changes broke ibm6 support (Bill Havanki via phunt)

Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/src/java/main/org/apache/zookeeper/server/admin/Commands.java

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1612359&r1=1612358&r2=1612359&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Mon Jul 21 17:58:36 2014
@@ -714,6 +714,9 @@ BUGFIXES:
   ZOOKEEPER-1972. Fix invalid volatile long/int increment (++)
   (Hongchao Deng via phunt)
 
+  ZOOKEEPER-1973. Jetty Server changes broke ibm6 support
+  (Bill Havanki via phunt)
+
 IMPROVEMENTS:
 
   ZOOKEEPER-1170. Fix compiler (eclipse) warnings: unused imports,

Modified: zookeeper/trunk/src/java/main/org/apache/zookeeper/server/admin/Commands.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/admin/Commands.java?rev=1612359&r1=1612358&r2=1612359&view=diff
==============================================================================
--- zookeeper/trunk/src/java/main/org/apache/zookeeper/server/admin/Commands.java (original)
+++ zookeeper/trunk/src/java/main/org/apache/zookeeper/server/admin/Commands.java Mon Jul
21 17:58:36 2014
@@ -18,8 +18,6 @@
 
 package org.apache.zookeeper.server.admin;
 
-import java.lang.management.ManagementFactory;
-import java.lang.management.OperatingSystemMXBean;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -38,11 +36,10 @@ import org.apache.zookeeper.server.ZooTr
 import org.apache.zookeeper.server.quorum.Leader;
 import org.apache.zookeeper.server.quorum.LeaderZooKeeperServer;
 import org.apache.zookeeper.server.quorum.ReadOnlyZooKeeperServer;
+import org.apache.zookeeper.server.util.OSMXBean;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.sun.management.UnixOperatingSystemMXBean;
-
 /**
  * Class containing static methods for registering and running Commands, as well
  * as default Command definitions.
@@ -310,13 +307,9 @@ public class Commands {
             response.put("ephemerals_count", zkdb.getDataTree().getEphemeralsCount());
             response.put("approximate_data_size", zkdb.getDataTree().approximateDataSize());
 
-            OperatingSystemMXBean osMbean = ManagementFactory.getOperatingSystemMXBean();
-            if (osMbean != null && osMbean instanceof UnixOperatingSystemMXBean)
{
-                UnixOperatingSystemMXBean unixos = (UnixOperatingSystemMXBean) osMbean;
-
-                response.put("open_file_descriptor_count", unixos.getOpenFileDescriptorCount());
-                response.put("max_file_descriptor_count", unixos.getMaxFileDescriptorCount());
-            }
+            OSMXBean osMbean = new OSMXBean();
+            response.put("open_file_descriptor_count", osMbean.getOpenFileDescriptorCount());
+            response.put("max_file_descriptor_count", osMbean.getMaxFileDescriptorCount());
 
             if (zkServer instanceof LeaderZooKeeperServer) {
                 Leader leader = ((LeaderZooKeeperServer) zkServer).getLeader();



Mime
View raw message