org.apache.hadoop.yarn.client.api.async.impl
Class NMClientAsyncImpl

java.lang.Object
  extended by org.apache.hadoop.service.AbstractService
      extended by org.apache.hadoop.yarn.client.api.async.NMClientAsync
          extended by org.apache.hadoop.yarn.client.api.async.impl.NMClientAsyncImpl
All Implemented Interfaces:
Closeable, org.apache.hadoop.service.Service

@InterfaceAudience.Private
@InterfaceStability.Unstable
public class NMClientAsyncImpl
extends NMClientAsync


Nested Class Summary
protected static class NMClientAsyncImpl.ContainerEvent
           
protected  class NMClientAsyncImpl.ContainerEventProcessor
           
protected static class NMClientAsyncImpl.ContainerEventType
          The type of the event of interacting with a container
protected static class NMClientAsyncImpl.ContainerState
           
protected static class NMClientAsyncImpl.StartContainerEvent
           
protected static class NMClientAsyncImpl.StatefulContainer
           
 
Nested classes/interfaces inherited from class org.apache.hadoop.yarn.client.api.async.NMClientAsync
NMClientAsync.CallbackHandler
 
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE
 
Field Summary
protected  ConcurrentMap<org.apache.hadoop.yarn.api.records.ContainerId,NMClientAsyncImpl.StatefulContainer> containers
           
protected  Thread eventDispatcherThread
           
protected  BlockingQueue<NMClientAsyncImpl.ContainerEvent> events
           
protected static int INITIAL_THREAD_POOL_SIZE
           
protected  int maxThreadPoolSize
           
protected  AtomicBoolean stopped
           
protected  ThreadPoolExecutor threadPool
           
 
Fields inherited from class org.apache.hadoop.yarn.client.api.async.NMClientAsync
callbackHandler, client
 
Constructor Summary
  NMClientAsyncImpl(NMClientAsync.CallbackHandler callbackHandler)
           
  NMClientAsyncImpl(String name, NMClientAsync.CallbackHandler callbackHandler)
           
protected NMClientAsyncImpl(String name, NMClient client, NMClientAsync.CallbackHandler callbackHandler)
           
 
Method Summary
protected  NMClientAsyncImpl.ContainerEventProcessor getContainerEventProcessor(NMClientAsyncImpl.ContainerEvent event)
           
 void getContainerStatusAsync(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.NodeId nodeId)
           
protected  boolean isCompletelyDone(NMClientAsyncImpl.StatefulContainer container)
           
protected  void serviceInit(org.apache.hadoop.conf.Configuration conf)
           
protected  void serviceStart()
           
protected  void serviceStop()
           
 void startContainerAsync(org.apache.hadoop.yarn.api.records.Container container, org.apache.hadoop.yarn.api.records.ContainerLaunchContext containerLaunchContext)
           
 void stopContainerAsync(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.NodeId nodeId)
           
 
Methods inherited from class org.apache.hadoop.yarn.client.api.async.NMClientAsync
createNMClientAsync, getCallbackHandler, getClient, setCallbackHandler, setClient
 
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
 

Field Detail

INITIAL_THREAD_POOL_SIZE

protected static final int INITIAL_THREAD_POOL_SIZE
See Also:
Constant Field Values

threadPool

protected ThreadPoolExecutor threadPool

maxThreadPoolSize

protected int maxThreadPoolSize

eventDispatcherThread

protected Thread eventDispatcherThread

stopped

protected AtomicBoolean stopped

events

protected BlockingQueue<NMClientAsyncImpl.ContainerEvent> events

containers

protected ConcurrentMap<org.apache.hadoop.yarn.api.records.ContainerId,NMClientAsyncImpl.StatefulContainer> containers
Constructor Detail

NMClientAsyncImpl

public NMClientAsyncImpl(NMClientAsync.CallbackHandler callbackHandler)

NMClientAsyncImpl

public NMClientAsyncImpl(String name,
                         NMClientAsync.CallbackHandler callbackHandler)

NMClientAsyncImpl

@InterfaceAudience.Private
protected NMClientAsyncImpl(String name,
                                                      NMClient client,
                                                      NMClientAsync.CallbackHandler callbackHandler)
Method Detail

serviceInit

protected void serviceInit(org.apache.hadoop.conf.Configuration conf)
                    throws Exception
Overrides:
serviceInit in class org.apache.hadoop.service.AbstractService
Throws:
Exception

serviceStart

protected void serviceStart()
                     throws Exception
Overrides:
serviceStart in class org.apache.hadoop.service.AbstractService
Throws:
Exception

serviceStop

protected void serviceStop()
                    throws Exception
Overrides:
serviceStop in class org.apache.hadoop.service.AbstractService
Throws:
Exception

startContainerAsync

public void startContainerAsync(org.apache.hadoop.yarn.api.records.Container container,
                                org.apache.hadoop.yarn.api.records.ContainerLaunchContext containerLaunchContext)
Specified by:
startContainerAsync in class NMClientAsync

stopContainerAsync

public void stopContainerAsync(org.apache.hadoop.yarn.api.records.ContainerId containerId,
                               org.apache.hadoop.yarn.api.records.NodeId nodeId)
Specified by:
stopContainerAsync in class NMClientAsync

getContainerStatusAsync

public void getContainerStatusAsync(org.apache.hadoop.yarn.api.records.ContainerId containerId,
                                    org.apache.hadoop.yarn.api.records.NodeId nodeId)
Specified by:
getContainerStatusAsync in class NMClientAsync

isCompletelyDone

protected boolean isCompletelyDone(NMClientAsyncImpl.StatefulContainer container)

getContainerEventProcessor

protected NMClientAsyncImpl.ContainerEventProcessor getContainerEventProcessor(NMClientAsyncImpl.ContainerEvent event)


Copyright © 2014 Apache Software Foundation. All Rights Reserved.