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
ConstructorsConstructorDescriptionNodeResourceMonitorImpl(Context context) Initialize the node resource monitor. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.yarn.api.records.ResourceUtilizationGet the resource utilization of the node.protected voidserviceInit(org.apache.hadoop.conf.Configuration conf) Initialize the service with the proper parameters.protected voidStart the thread that does the node resource utilization monitoring.protected voidStop 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, waitForServiceToStopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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
Initialize the node resource monitor.
-
-
Method Details
-
serviceInit
Initialize the service with the proper parameters.- Overrides:
serviceInitin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
serviceStart
Start the thread that does the node resource utilization monitoring.- Overrides:
serviceStartin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
serviceStop
Stop the thread that does the node resource utilization monitoring.- Overrides:
serviceStopin classorg.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:
getUtilizationin interfaceNodeResourceMonitor- Returns:
- resource utilization of the node.
-