Class SysInfo

java.lang.Object
org.apache.hadoop.util.SysInfo

@Public @Evolving public abstract class SysInfo extends Object
Plugin to calculate resource information on the system.
  • Constructor Details

    • SysInfo

      public SysInfo()
  • Method Details

    • newInstance

      public static SysInfo newInstance()
      Return default OS instance.
      Returns:
      Default instance for the detected OS.
      Throws:
      UnsupportedOperationException - If cannot determine OS.
    • getVirtualMemorySize

      public abstract long getVirtualMemorySize()
      Obtain the total size of the virtual memory present in the system.
      Returns:
      virtual memory size in bytes.
    • getPhysicalMemorySize

      public abstract long getPhysicalMemorySize()
      Obtain the total size of the physical memory present in the system.
      Returns:
      physical memory size bytes.
    • getAvailableVirtualMemorySize

      public abstract long getAvailableVirtualMemorySize()
      Obtain the total size of the available virtual memory present in the system.
      Returns:
      available virtual memory size in bytes.
    • getAvailablePhysicalMemorySize

      public abstract long getAvailablePhysicalMemorySize()
      Obtain the total size of the available physical memory present in the system.
      Returns:
      available physical memory size bytes.
    • getNumProcessors

      public abstract int getNumProcessors()
      Obtain the total number of logical processors present on the system.
      Returns:
      number of logical processors
    • getNumCores

      public abstract int getNumCores()
      Obtain total number of physical cores present on the system.
      Returns:
      number of physical cores
    • getCpuFrequency

      public abstract long getCpuFrequency()
      Obtain the CPU frequency of on the system.
      Returns:
      CPU frequency in kHz
    • getCumulativeCpuTime

      public abstract long getCumulativeCpuTime()
      Obtain the cumulative CPU time since the system is on.
      Returns:
      cumulative CPU time in milliseconds
    • getCpuUsagePercentage

      public abstract float getCpuUsagePercentage()
      Obtain the CPU usage % of the machine. Return -1 if it is unavailable
      Returns:
      CPU usage as a percentage (from 0 to 100) of available cycles.
    • getNumVCoresUsed

      public abstract float getNumVCoresUsed()
      Obtain the number of VCores used. Return -1 if it is unavailable
      Returns:
      Number of VCores used a percentage (from 0 to #VCores).
    • getNetworkBytesRead

      public abstract long getNetworkBytesRead()
      Obtain the aggregated number of bytes read over the network.
      Returns:
      total number of bytes read.
    • getNetworkBytesWritten

      public abstract long getNetworkBytesWritten()
      Obtain the aggregated number of bytes written to the network.
      Returns:
      total number of bytes written.
    • getStorageBytesRead

      public abstract long getStorageBytesRead()
      Obtain the aggregated number of bytes read from disks.
      Returns:
      total number of bytes read.
    • getStorageBytesWritten

      public abstract long getStorageBytesWritten()
      Obtain the aggregated number of bytes written to disks.
      Returns:
      total number of bytes written.