Spring for Apache Hadoop

org.springframework.yarn.am.monitor
Class DefaultContainerMonitor

java.lang.Object
  extended by org.springframework.yarn.support.LifecycleObjectSupport
      extended by org.springframework.yarn.am.monitor.AbstractMonitor
          extended by org.springframework.yarn.am.monitor.DefaultContainerMonitor
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, ContainerAware, ContainerMonitor

public class DefaultContainerMonitor
extends AbstractMonitor
implements ContainerAware, ContainerMonitor

Default implementation of ContainerMonitor which simple tracks number of total and completed containers.

Author:
Janne Valkealahti

Constructor Summary
DefaultContainerMonitor()
           
 
Method Summary
 int completedCount()
          Gets a count of completed containers.
 int failedCount()
          Gets a count of failed containers.
 int freeCount()
          Gets a count of free containers.
 void onContainer(java.util.List<org.apache.hadoop.yarn.api.records.Container> containers)
          Called when we potentially have new information about a Containers.
 void onContainerStatus(java.util.List<org.apache.hadoop.yarn.api.records.ContainerStatus> containerStatuses)
          Called when we potentially have new information about a ContainerStatuss.
 int runningCount()
          Gets a count of running containers.
 java.lang.String toDebugString()
          Gets this class description as a debug string.
 
Methods inherited from class org.springframework.yarn.am.monitor.AbstractMonitor
addContainerMonitorStateListener, notifyState
 
Methods inherited from class org.springframework.yarn.support.LifecycleObjectSupport
afterPropertiesSet, doStart, doStop, getBeanFactory, getPhase, getTaskExecutor, getTaskScheduler, getYarnEventPublisher, isAutoStartup, isRunning, onInit, setAutoStartup, setBeanFactory, setPhase, setTaskExecutor, setTaskScheduler, setYarnEventPublisher, start, stop, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.yarn.am.monitor.ContainerMonitor
addContainerMonitorStateListener
 

Constructor Detail

DefaultContainerMonitor

public DefaultContainerMonitor()
Method Detail

onContainer

public void onContainer(java.util.List<org.apache.hadoop.yarn.api.records.Container> containers)
Description copied from interface: ContainerAware
Called when we potentially have new information about a Containers.

Specified by:
onContainer in interface ContainerAware
Parameters:
containers - the containers

onContainerStatus

public void onContainerStatus(java.util.List<org.apache.hadoop.yarn.api.records.ContainerStatus> containerStatuses)
Description copied from interface: ContainerAware
Called when we potentially have new information about a ContainerStatuss.

Specified by:
onContainerStatus in interface ContainerAware
Parameters:
containerStatuses - the container statuses

freeCount

public int freeCount()
Description copied from interface: ContainerMonitor
Gets a count of free containers.

Specified by:
freeCount in interface ContainerMonitor
Returns:
count of free containers

runningCount

public int runningCount()
Description copied from interface: ContainerMonitor
Gets a count of running containers.

Specified by:
runningCount in interface ContainerMonitor
Returns:
count of running containers

failedCount

public int failedCount()
Description copied from interface: ContainerMonitor
Gets a count of failed containers.

Specified by:
failedCount in interface ContainerMonitor
Returns:
count of failed containers

completedCount

public int completedCount()
Description copied from interface: ContainerMonitor
Gets a count of completed containers.

Specified by:
completedCount in interface ContainerMonitor
Returns:
count of completed containers

toDebugString

public java.lang.String toDebugString()
Gets this class description as a debug string.

Returns:
class description as a debug string

Spring for Apache Hadoop