org.apache.hadoop.hbase.util
Class JVM

java.lang.Object
  extended by org.apache.hadoop.hbase.util.JVM

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class JVM
extends Object

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
JVM()
          Constructor.
 
Method Summary
 long getMaxFileDescriptorCount()
          Get the number of the maximum file descriptors the system can use.
 long getOpenFileDescriptorCount()
          Get the number of opened filed descriptor for the runtime jvm.
static boolean isGZIPOutputStreamFinishBroken()
          Check if the finish() method of GZIPOutputStream is broken
static boolean isUnix()
          Check if the OS is unix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JVM

public JVM()
Constructor. Get the running Operating System instance

Method Detail

isUnix

public static boolean isUnix()
Check if the OS is unix.

Returns:
whether this is unix or not.

isGZIPOutputStreamFinishBroken

public static boolean isGZIPOutputStreamFinishBroken()
Check if the finish() method of GZIPOutputStream is broken

Returns:
whether GZIPOutputStream.finish() is broken.

getOpenFileDescriptorCount

public long getOpenFileDescriptorCount()
Get the number of opened filed descriptor for the runtime jvm. If Oracle 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 Oracle 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.


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.