public class SliderYarnClientImpl
extends org.apache.hadoop.yarn.client.api.impl.YarnClientImpl
| Modifier and Type | Field and Description |
|---|---|
static String |
KILL_ALL
Keyword to use in the
emergencyForceKill(String)
operation to force kill all application instances belonging
to a specific user |
protected static org.slf4j.Logger |
log |
| Constructor and Description |
|---|
SliderYarnClientImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
emergencyForceKill(String applicationId)
Force kill a yarn application by ID.
|
List<org.apache.hadoop.yarn.api.records.ApplicationReport> |
findAllInstances(String user,
String appname)
find all instances of a specific app -if there is more than one in the
YARN cluster,
this returns them all
|
List<org.apache.hadoop.yarn.api.records.ApplicationReport> |
findAllLiveInstances(String user,
String appname)
find all live instances of a specific app -if there is >1 in the cluster,
this returns them all.
|
org.apache.hadoop.yarn.api.records.ApplicationReport |
findAppInInstanceList(List<org.apache.hadoop.yarn.api.records.ApplicationReport> instances,
String appname,
org.apache.hadoop.yarn.api.records.YarnApplicationState desiredState)
Find an app in the instance list in the desired state
|
org.apache.hadoop.yarn.api.records.ApplicationReport |
findClusterInInstanceList(List<org.apache.hadoop.yarn.api.records.ApplicationReport> instances,
String appname)
Find a cluster in the instance list; biased towards live instances
|
org.apache.hadoop.yarn.api.ApplicationClientProtocol |
getRmClient()
Get the RM Client RPC interface
|
boolean |
isApplicationLive(org.apache.hadoop.yarn.api.records.ApplicationReport app)
Helper method to determine if a cluster application is running -or
is earlier in the lifecycle
|
org.apache.hadoop.yarn.api.protocolrecords.KillApplicationResponse |
killRunningApplication(org.apache.hadoop.yarn.api.records.ApplicationId applicationId,
String reason)
Kill a running application
|
List<org.apache.hadoop.yarn.api.records.ApplicationReport> |
listDeployedInstances(String user)
List Slider deployedinstances belonging to a specific user.
|
List<org.apache.hadoop.yarn.api.records.ApplicationReport> |
listInstances(String user)
Deprecated.
|
NodeInformationList |
listNodes(String label,
boolean live)
List the nodes in the cluster, possibly filtering by node state or label.
|
org.apache.hadoop.yarn.api.records.ApplicationReport |
monitorAppToState(org.apache.hadoop.yarn.api.records.ApplicationId appId,
org.apache.hadoop.yarn.api.records.YarnApplicationState desiredState,
Duration duration)
Monitor the submitted application for reaching the requested state.
|
protected void |
serviceInit(org.apache.hadoop.conf.Configuration conf) |
createApplication, deleteReservation, getAllQueues, getAMRMToken, getApplicationAttemptReport, getApplicationAttempts, getApplicationReport, getApplications, getApplications, getApplications, getApplications, getChildQueueInfos, getClusterNodeLabels, getContainerReport, getContainers, getLabelsToNodes, getLabelsToNodes, getNodeReports, getNodeToLabels, getQueueAclsInfo, getQueueInfo, getRMDelegationToken, getRootQueueInfos, getYarnClusterMetrics, isSecurityEnabled, killApplication, moveApplicationAcrossQueues, serviceStart, serviceStop, setRMClient, submitApplication, submitReservation, updateReservationclose, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStopprotected static final org.slf4j.Logger log
public static final String KILL_ALL
emergencyForceKill(String)
operation to force kill all application instances belonging
to a specific userprotected void serviceInit(org.apache.hadoop.conf.Configuration conf)
throws Exception
serviceInit in class org.apache.hadoop.yarn.client.api.impl.YarnClientImplExceptionpublic org.apache.hadoop.yarn.api.ApplicationClientProtocol getRmClient()
public List<org.apache.hadoop.yarn.api.records.ApplicationReport> listInstances(String user) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
listDeployedInstances(String)user - user: "" means all usersorg.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic List<org.apache.hadoop.yarn.api.records.ApplicationReport> listDeployedInstances(String user) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
Deployed means: known about in the YARN cluster; it will include any that are in the failed/finished state, as well as those queued for starting.
user - user: "" means all usersorg.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic List<org.apache.hadoop.yarn.api.records.ApplicationReport> findAllInstances(String user, String appname) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
user - user; use "" for all usersappname - application nameIOExceptionorg.apache.hadoop.yarn.exceptions.YarnExceptionpublic boolean isApplicationLive(org.apache.hadoop.yarn.api.records.ApplicationReport app)
app - application reportpublic org.apache.hadoop.yarn.api.protocolrecords.KillApplicationResponse killRunningApplication(org.apache.hadoop.yarn.api.records.ApplicationId applicationId,
String reason)
throws org.apache.hadoop.yarn.exceptions.YarnException,
IOException
applicationId - app Idreason - reason: reason for logorg.apache.hadoop.yarn.exceptions.YarnException - YARN problemsIOException - IO problemspublic void emergencyForceKill(String applicationId) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
applicationId - app Id. "all" means "kill all instances of the current userorg.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic org.apache.hadoop.yarn.api.records.ApplicationReport monitorAppToState(org.apache.hadoop.yarn.api.records.ApplicationId appId,
org.apache.hadoop.yarn.api.records.YarnApplicationState desiredState,
Duration duration)
throws org.apache.hadoop.yarn.exceptions.YarnException,
IOException
appId - Application Id of application to be monitoredduration - how long to wait -must be more than 0desiredState - desired state.org.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic List<org.apache.hadoop.yarn.api.records.ApplicationReport> findAllLiveInstances(String user, String appname) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
user - userappname - application nameorg.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic org.apache.hadoop.yarn.api.records.ApplicationReport findClusterInInstanceList(List<org.apache.hadoop.yarn.api.records.ApplicationReport> instances, String appname)
instances - list of instancesappname - application namepublic org.apache.hadoop.yarn.api.records.ApplicationReport findAppInInstanceList(List<org.apache.hadoop.yarn.api.records.ApplicationReport> instances, String appname, org.apache.hadoop.yarn.api.records.YarnApplicationState desiredState)
instances - instance listappname - application namedesiredState - yarn state desiredpublic NodeInformationList listNodes(String label, boolean live) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
label - label to filter by -or "" for anylive - flag to request running nodes onlyIOException - IO problemsorg.apache.hadoop.yarn.exceptions.YarnException - YARN problemsCopyright © 2014–2015 The Apache Software Foundation. All rights reserved.