Package org.apache.zookeeper.server.util
Class OSMXBean
java.lang.Object
org.apache.zookeeper.server.util.OSMXBean
This class is a wrapper for the implementation of
com.sun.management.UnixOperatingSystemMXBean
It will decide to use the sun api or its own implementation
depending on the runtime (vendor) used.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
Get the number of the maximum file descriptors the system can use.long
Get the number of opened filed descriptor for the runtime jvm.boolean
getUnix()
Check if the OS is unix.
-
Constructor Details
-
OSMXBean
public OSMXBean()Constructor. Get the running Operating System instance
-
-
Method Details
-
getUnix
public boolean getUnix()Check if the OS is unix. If using the IBM java runtime, this will only work for linux.- Returns:
- whether this is unix or not.
-
getOpenFileDescriptorCount
public long getOpenFileDescriptorCount()Get the number of opened filed descriptor for the runtime jvm. If sun java, it will use the com.sun.management interfaces. Otherwise, this methods implements it (linux only).- Returns:
- number of open file descriptors for the jvm
-
getMaxFileDescriptorCount
public long getMaxFileDescriptorCount()Get the number of the maximum file descriptors the system can use. If sun java, it will use the com.sun.management interfaces. Otherwise, this methods implements it (linux only).- Returns:
- max number of file descriptors the operating system can use.
-