Class NodeResourceMonitorImpl

java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.yarn.server.nodemanager.NodeResourceMonitorImpl
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.hadoop.service.Service, NodeResourceMonitor

public class NodeResourceMonitorImpl extends org.apache.hadoop.service.AbstractService implements NodeResourceMonitor
Implementation of the node resource monitor. It periodically tracks the resource utilization of the node and reports it to the NM.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service

    org.apache.hadoop.service.Service.STATE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Initialize the node resource monitor.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.hadoop.yarn.api.records.ResourceUtilization
    Get the resource utilization of the node.
    protected void
    serviceInit(org.apache.hadoop.conf.Configuration conf)
    Initialize the service with the proper parameters.
    protected void
    Start the thread that does the node resource utilization monitoring.
    protected void
    Stop the thread that does the node resource utilization monitoring.

    Methods inherited from class org.apache.hadoop.service.AbstractService

    close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.hadoop.service.Service

    close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, registerServiceListener, start, stop, unregisterServiceListener, waitForServiceToStop
  • Constructor Details

    • NodeResourceMonitorImpl

      public NodeResourceMonitorImpl(Context context)
      Initialize the node resource monitor.
  • Method Details

    • serviceInit

      protected void serviceInit(org.apache.hadoop.conf.Configuration conf) throws Exception
      Initialize the service with the proper parameters.
      Overrides:
      serviceInit in class org.apache.hadoop.service.AbstractService
      Throws:
      Exception
    • serviceStart

      protected void serviceStart() throws Exception
      Start the thread that does the node resource utilization monitoring.
      Overrides:
      serviceStart in class org.apache.hadoop.service.AbstractService
      Throws:
      Exception
    • serviceStop

      protected void serviceStop() throws Exception
      Stop the thread that does the node resource utilization monitoring.
      Overrides:
      serviceStop in class org.apache.hadoop.service.AbstractService
      Throws:
      Exception
    • getUtilization

      public org.apache.hadoop.yarn.api.records.ResourceUtilization getUtilization()
      Get the resource utilization of the node.
      Specified by:
      getUtilization in interface NodeResourceMonitor
      Returns:
      resource utilization of the node.