public class YARNRunner extends Object implements ClientProtocol
versionID| Constructor and Description |
|---|
YARNRunner(Configuration conf)
Yarn runner incapsulates the client interface of
yarn
|
YARNRunner(Configuration conf,
ResourceMgrDelegate resMgrDelegate)
Similar to
YARNRunner(Configuration) but allowing injecting
ResourceMgrDelegate. |
YARNRunner(Configuration conf,
ResourceMgrDelegate resMgrDelegate,
ClientCache clientCache)
Similar to
YARNRunner(Configuration, ResourceMgrDelegate)
but allowing injecting ClientCache. |
| Modifier and Type | Method and Description |
|---|---|
void |
cancelDelegationToken(Token<DelegationTokenIdentifier> arg0)
Cancel a delegation token.
|
ApplicationSubmissionContext |
createApplicationSubmissionContext(Configuration jobConf,
String jobSubmitDir,
Credentials ts) |
TaskTrackerInfo[] |
getActiveTrackers()
Get all active trackers in cluster.
|
JobStatus[] |
getAllJobs()
Get all the jobs submitted.
|
TaskTrackerInfo[] |
getBlacklistedTrackers()
Get all blacklisted trackers in cluster.
|
QueueInfo[] |
getChildQueues(String parent)
Returns immediate children of queueName.
|
ClusterMetrics |
getClusterMetrics()
Get the current status of the cluster
|
Token<DelegationTokenIdentifier> |
getDelegationToken(Text renewer)
Get a new delegation token.
|
String |
getFilesystemName()
A MapReduce system always operates on a single filesystem.
|
Counters |
getJobCounters(JobID arg0)
Grab the current job counters
|
String |
getJobHistoryDir()
Gets the directory location of the completed job history files.
|
JobStatus |
getJobStatus(JobID jobID)
Grab a handle to a job that is already known to the JobTracker.
|
Cluster.JobTrackerStatus |
getJobTrackerStatus()
Get the JobTracker's status.
|
LogParams |
getLogFileParams(JobID jobID,
TaskAttemptID taskAttemptID)
Gets the location of the log file for a job if no taskAttemptId is
specified, otherwise gets the log location for the taskAttemptId.
|
JobID |
getNewJobID()
Allocate a name for the job.
|
ProtocolSignature |
getProtocolSignature(String protocol,
long clientVersion,
int clientMethodsHash)
Return protocol version corresponding to protocol interface.
|
long |
getProtocolVersion(String arg0,
long arg1)
Return protocol version corresponding to protocol interface.
|
QueueInfo |
getQueue(String queueName)
Gets scheduling information associated with the particular Job queue
|
QueueAclsInfo[] |
getQueueAclsForCurrentUser()
Gets the Queue ACLs for current user
|
AccessControlList |
getQueueAdmins(String arg0)
Get the administrators of the given job-queue.
|
QueueInfo[] |
getQueues()
Gets set of Queues associated with the Job Tracker
|
QueueInfo[] |
getRootQueues()
Gets the root level queues.
|
String |
getStagingAreaDir()
Get a hint from the JobTracker
where job-specific files are to be placed.
|
String |
getSystemDir()
Grab the jobtracker system directory path
where job-specific files are to be placed.
|
TaskCompletionEvent[] |
getTaskCompletionEvents(JobID arg0,
int arg1,
int arg2)
Get task completion events for the jobid, starting from fromEventId.
|
String[] |
getTaskDiagnostics(TaskAttemptID arg0)
Get the diagnostics for a given task in a given job
|
TaskReport[] |
getTaskReports(JobID jobID,
TaskType taskType)
Grab a bunch of info on the tasks that make up the job
|
long |
getTaskTrackerExpiryInterval() |
void |
killJob(JobID arg0)
Kill the indicated job
|
boolean |
killTask(TaskAttemptID arg0,
boolean arg1)
Kill indicated task attempt.
|
long |
renewDelegationToken(Token<DelegationTokenIdentifier> arg0)
Renew an existing delegation token
|
void |
setJobPriority(JobID arg0,
String arg1)
Set the priority of the specified job
|
void |
setResourceMgrDelegate(ResourceMgrDelegate resMgrDelegate) |
JobStatus |
submitJob(JobID jobId,
String jobSubmitDir,
Credentials ts)
Submit a Job for execution.
|
public YARNRunner(Configuration conf)
conf - the configuration object for the clientpublic YARNRunner(Configuration conf, ResourceMgrDelegate resMgrDelegate)
YARNRunner(Configuration) but allowing injecting
ResourceMgrDelegate. Enables mocking and testing.conf - the configuration object for the clientresMgrDelegate - the resourcemanager client handle.public YARNRunner(Configuration conf, ResourceMgrDelegate resMgrDelegate, ClientCache clientCache)
YARNRunner(Configuration, ResourceMgrDelegate)
but allowing injecting ClientCache. Enable mocking and testing.conf - the configuration objectresMgrDelegate - the resource manager delegateclientCache - the client cache object.@InterfaceAudience.Private public void setResourceMgrDelegate(ResourceMgrDelegate resMgrDelegate)
public void cancelDelegationToken(Token<DelegationTokenIdentifier> arg0) throws IOException, InterruptedException
ClientProtocolcancelDelegationToken in interface ClientProtocolarg0 - the token to cancelIOExceptionInterruptedExceptionpublic TaskTrackerInfo[] getActiveTrackers() throws IOException, InterruptedException
ClientProtocolgetActiveTrackers in interface ClientProtocolIOExceptionInterruptedExceptionpublic JobStatus[] getAllJobs() throws IOException, InterruptedException
ClientProtocolgetAllJobs in interface ClientProtocolIOExceptionInterruptedExceptionpublic TaskTrackerInfo[] getBlacklistedTrackers() throws IOException, InterruptedException
ClientProtocolgetBlacklistedTrackers in interface ClientProtocolIOExceptionInterruptedExceptionpublic ClusterMetrics getClusterMetrics() throws IOException, InterruptedException
ClientProtocolgetClusterMetrics in interface ClientProtocolIOExceptionInterruptedExceptionpublic Token<DelegationTokenIdentifier> getDelegationToken(Text renewer) throws IOException, InterruptedException
ClientProtocolgetDelegationToken in interface ClientProtocolrenewer - the user other than the creator (if any) that can renew the
tokenIOExceptionInterruptedExceptionpublic String getFilesystemName() throws IOException, InterruptedException
ClientProtocolgetFilesystemName in interface ClientProtocolIOExceptionInterruptedExceptionpublic JobID getNewJobID() throws IOException, InterruptedException
ClientProtocolgetNewJobID in interface ClientProtocolIOExceptionInterruptedExceptionpublic QueueInfo getQueue(String queueName) throws IOException, InterruptedException
ClientProtocolgetQueue in interface ClientProtocolqueueName - Queue NameIOExceptionInterruptedExceptionpublic QueueAclsInfo[] getQueueAclsForCurrentUser() throws IOException, InterruptedException
ClientProtocolgetQueueAclsForCurrentUser in interface ClientProtocolIOExceptionInterruptedExceptionpublic QueueInfo[] getQueues() throws IOException, InterruptedException
ClientProtocolgetQueues in interface ClientProtocolIOExceptionInterruptedExceptionpublic QueueInfo[] getRootQueues() throws IOException, InterruptedException
ClientProtocolgetRootQueues in interface ClientProtocolIOExceptionInterruptedExceptionpublic QueueInfo[] getChildQueues(String parent) throws IOException, InterruptedException
ClientProtocolgetChildQueues in interface ClientProtocolIOExceptionInterruptedExceptionpublic String getStagingAreaDir() throws IOException, InterruptedException
ClientProtocolgetStagingAreaDir in interface ClientProtocolIOExceptionInterruptedExceptionpublic String getSystemDir() throws IOException, InterruptedException
ClientProtocolgetSystemDir in interface ClientProtocolIOExceptionInterruptedExceptionpublic long getTaskTrackerExpiryInterval()
throws IOException,
InterruptedException
getTaskTrackerExpiryInterval in interface ClientProtocolIOExceptionInterruptedExceptionpublic JobStatus submitJob(JobID jobId, String jobSubmitDir, Credentials ts) throws IOException, InterruptedException
ClientProtocolsubmitJob in interface ClientProtocolIOExceptionInterruptedExceptionpublic ApplicationSubmissionContext createApplicationSubmissionContext(Configuration jobConf, String jobSubmitDir, Credentials ts) throws IOException
IOExceptionpublic void setJobPriority(JobID arg0, String arg1) throws IOException, InterruptedException
ClientProtocolsetJobPriority in interface ClientProtocolarg0 - ID of the jobarg1 - Priority to be set for the jobIOExceptionInterruptedExceptionpublic long getProtocolVersion(String arg0, long arg1) throws IOException
VersionedProtocolgetProtocolVersion in interface VersionedProtocolarg0 - The classname of the protocol interfacearg1 - The version of the protocol that the client speaksIOException - if any IO error occurspublic long renewDelegationToken(Token<DelegationTokenIdentifier> arg0) throws IOException, InterruptedException
ClientProtocolrenewDelegationToken in interface ClientProtocolarg0 - the token to renewIOExceptionInterruptedExceptionpublic Counters getJobCounters(JobID arg0) throws IOException, InterruptedException
ClientProtocolgetJobCounters in interface ClientProtocolIOExceptionInterruptedExceptionpublic String getJobHistoryDir() throws IOException, InterruptedException
ClientProtocolgetJobHistoryDir in interface ClientProtocolIOExceptionInterruptedExceptionpublic JobStatus getJobStatus(JobID jobID) throws IOException, InterruptedException
ClientProtocolgetJobStatus in interface ClientProtocolIOExceptionInterruptedExceptionpublic TaskCompletionEvent[] getTaskCompletionEvents(JobID arg0, int arg1, int arg2) throws IOException, InterruptedException
ClientProtocolgetTaskCompletionEvents in interface ClientProtocolarg0 - job idarg1 - event id to start from.arg2 - the max number of events we want to look atIOExceptionInterruptedExceptionpublic String[] getTaskDiagnostics(TaskAttemptID arg0) throws IOException, InterruptedException
ClientProtocolgetTaskDiagnostics in interface ClientProtocolarg0 - the id of the taskIOExceptionInterruptedExceptionpublic TaskReport[] getTaskReports(JobID jobID, TaskType taskType) throws IOException, InterruptedException
ClientProtocolgetTaskReports in interface ClientProtocolIOExceptionInterruptedExceptionpublic void killJob(JobID arg0) throws IOException, InterruptedException
ClientProtocolkillJob in interface ClientProtocolIOExceptionInterruptedExceptionpublic boolean killTask(TaskAttemptID arg0, boolean arg1) throws IOException, InterruptedException
ClientProtocolkillTask in interface ClientProtocolarg0 - the id of the task to kill.arg1 - if true the task is failed and added to failed tasks list, otherwise
it is just killed, w/o affecting job failure status.IOExceptionInterruptedExceptionpublic AccessControlList getQueueAdmins(String arg0) throws IOException
ClientProtocolgetQueueAdmins in interface ClientProtocolIOExceptionpublic Cluster.JobTrackerStatus getJobTrackerStatus() throws IOException, InterruptedException
ClientProtocolgetJobTrackerStatus in interface ClientProtocolCluster.JobTrackerStatus of the JobTrackerIOExceptionInterruptedExceptionpublic ProtocolSignature getProtocolSignature(String protocol, long clientVersion, int clientMethodsHash) throws IOException
VersionedProtocolgetProtocolSignature in interface VersionedProtocolprotocol - The classname of the protocol interfaceclientVersion - The version of the protocol that the client speaksclientMethodsHash - the hashcode of client protocol methodsIOExceptionfor a default implementationpublic LogParams getLogFileParams(JobID jobID, TaskAttemptID taskAttemptID) throws IOException
ClientProtocolgetLogFileParams in interface ClientProtocoljobID - the jobId.taskAttemptID - the taskAttemptId.IOExceptionCopyright © 2013 Apache Software Foundation. All rights reserved.