Package org.apache.hadoop.mapred
Class YARNRunner
java.lang.Object
org.apache.hadoop.mapred.YARNRunner
- All Implemented Interfaces:
org.apache.hadoop.ipc.VersionedProtocol,org.apache.hadoop.mapreduce.protocol.ClientProtocol
public class YARNRunner
extends Object
implements org.apache.hadoop.mapreduce.protocol.ClientProtocol
This class enables the current JobClient (0.22 hadoop) to run on YARN.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.hadoop.yarn.api.records.PriorityFields inherited from interface org.apache.hadoop.mapreduce.protocol.ClientProtocol
versionID -
Constructor Summary
ConstructorsConstructorDescriptionYARNRunner(org.apache.hadoop.conf.Configuration conf) Yarn runner incapsulates the client interface of yarnYARNRunner(org.apache.hadoop.conf.Configuration conf, ResourceMgrDelegate resMgrDelegate) Similar toYARNRunner(Configuration)but allowing injectingResourceMgrDelegate.YARNRunner(org.apache.hadoop.conf.Configuration conf, ResourceMgrDelegate resMgrDelegate, ClientCache clientCache) Similar toYARNRunner(Configuration, ResourceMgrDelegate)but allowing injectingClientCache. -
Method Summary
Modifier and TypeMethodDescriptionvoidcancelDelegationToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier> arg0) voidclose()org.apache.hadoop.yarn.api.records.ApplicationSubmissionContextcreateApplicationSubmissionContext(org.apache.hadoop.conf.Configuration jobConf, String jobSubmitDir, org.apache.hadoop.security.Credentials ts) Constructs all the necessary information to start the MR AM.org.apache.hadoop.mapreduce.TaskTrackerInfo[]org.apache.hadoop.mapreduce.JobStatus[]org.apache.hadoop.mapreduce.TaskTrackerInfo[]org.apache.hadoop.mapreduce.QueueInfo[]getChildQueues(String parent) org.apache.hadoop.mapreduce.ClusterMetricsorg.apache.hadoop.security.token.Token<org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier>getDelegationToken(org.apache.hadoop.io.Text renewer) org.apache.hadoop.mapreduce.CountersgetJobCounters(org.apache.hadoop.mapreduce.JobID arg0) org.apache.hadoop.mapreduce.JobStatusgetJobStatus(org.apache.hadoop.mapreduce.JobID jobID) org.apache.hadoop.mapreduce.Cluster.JobTrackerStatusorg.apache.hadoop.mapreduce.v2.LogParamsgetLogFileParams(org.apache.hadoop.mapreduce.JobID jobID, org.apache.hadoop.mapreduce.TaskAttemptID taskAttemptID) org.apache.hadoop.mapreduce.JobIDorg.apache.hadoop.ipc.ProtocolSignaturegetProtocolSignature(String protocol, long clientVersion, int clientMethodsHash) longgetProtocolVersion(String arg0, long arg1) org.apache.hadoop.mapreduce.QueueInfoorg.apache.hadoop.mapreduce.QueueAclsInfo[]org.apache.hadoop.security.authorize.AccessControlListgetQueueAdmins(String arg0) org.apache.hadoop.mapreduce.QueueInfo[]org.apache.hadoop.mapreduce.QueueInfo[]org.apache.hadoop.mapreduce.TaskCompletionEvent[]getTaskCompletionEvents(org.apache.hadoop.mapreduce.JobID arg0, int arg1, int arg2) String[]getTaskDiagnostics(org.apache.hadoop.mapreduce.TaskAttemptID arg0) org.apache.hadoop.mapreduce.TaskReport[]getTaskReports(org.apache.hadoop.mapreduce.JobID jobID, org.apache.hadoop.mapreduce.TaskType taskType) longvoidkillJob(org.apache.hadoop.mapreduce.JobID arg0) booleankillTask(org.apache.hadoop.mapreduce.TaskAttemptID arg0, boolean arg1) longrenewDelegationToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier> arg0) voidsetJobPriority(org.apache.hadoop.mapreduce.JobID arg0, String arg1) voidsetResourceMgrDelegate(ResourceMgrDelegate resMgrDelegate) org.apache.hadoop.mapreduce.JobStatussubmitJob(org.apache.hadoop.mapreduce.JobID jobId, String jobSubmitDir, org.apache.hadoop.security.Credentials ts)
-
Field Details
-
AM_CONTAINER_PRIORITY
public static final org.apache.hadoop.yarn.api.records.Priority AM_CONTAINER_PRIORITY
-
-
Constructor Details
-
YARNRunner
public YARNRunner(org.apache.hadoop.conf.Configuration conf) Yarn runner incapsulates the client interface of yarn- Parameters:
conf- the configuration object for the client
-
YARNRunner
Similar toYARNRunner(Configuration)but allowing injectingResourceMgrDelegate. Enables mocking and testing.- Parameters:
conf- the configuration object for the clientresMgrDelegate- the resourcemanager client handle.
-
YARNRunner
public YARNRunner(org.apache.hadoop.conf.Configuration conf, ResourceMgrDelegate resMgrDelegate, ClientCache clientCache) Similar toYARNRunner(Configuration, ResourceMgrDelegate)but allowing injectingClientCache. Enable mocking and testing.- Parameters:
conf- the configuration objectresMgrDelegate- the resource manager delegateclientCache- the client cache object.
-
-
Method Details
-
setResourceMgrDelegate
-
cancelDelegationToken
public void cancelDelegationToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier> arg0) throws IOException, InterruptedException - Specified by:
cancelDelegationTokenin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getActiveTrackers
public org.apache.hadoop.mapreduce.TaskTrackerInfo[] getActiveTrackers() throws IOException, InterruptedException- Specified by:
getActiveTrackersin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getAllJobs
public org.apache.hadoop.mapreduce.JobStatus[] getAllJobs() throws IOException, InterruptedException- Specified by:
getAllJobsin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getBlacklistedTrackers
public org.apache.hadoop.mapreduce.TaskTrackerInfo[] getBlacklistedTrackers() throws IOException, InterruptedException- Specified by:
getBlacklistedTrackersin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getClusterMetrics
public org.apache.hadoop.mapreduce.ClusterMetrics getClusterMetrics() throws IOException, InterruptedException- Specified by:
getClusterMetricsin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getDelegationToken
public org.apache.hadoop.security.token.Token<org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier> getDelegationToken(org.apache.hadoop.io.Text renewer) throws IOException, InterruptedException - Specified by:
getDelegationTokenin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getFilesystemName
- Specified by:
getFilesystemNamein interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getNewJobID
- Specified by:
getNewJobIDin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getQueue
public org.apache.hadoop.mapreduce.QueueInfo getQueue(String queueName) throws IOException, InterruptedException - Specified by:
getQueuein interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getQueueAclsForCurrentUser
public org.apache.hadoop.mapreduce.QueueAclsInfo[] getQueueAclsForCurrentUser() throws IOException, InterruptedException- Specified by:
getQueueAclsForCurrentUserin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getQueues
- Specified by:
getQueuesin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getRootQueues
public org.apache.hadoop.mapreduce.QueueInfo[] getRootQueues() throws IOException, InterruptedException- Specified by:
getRootQueuesin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getChildQueues
public org.apache.hadoop.mapreduce.QueueInfo[] getChildQueues(String parent) throws IOException, InterruptedException - Specified by:
getChildQueuesin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getStagingAreaDir
- Specified by:
getStagingAreaDirin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getSystemDir
- Specified by:
getSystemDirin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getTaskTrackerExpiryInterval
- Specified by:
getTaskTrackerExpiryIntervalin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
submitJob
public org.apache.hadoop.mapreduce.JobStatus submitJob(org.apache.hadoop.mapreduce.JobID jobId, String jobSubmitDir, org.apache.hadoop.security.Credentials ts) throws IOException, InterruptedException - Specified by:
submitJobin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
createApplicationSubmissionContext
public org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext createApplicationSubmissionContext(org.apache.hadoop.conf.Configuration jobConf, String jobSubmitDir, org.apache.hadoop.security.Credentials ts) throws IOException Constructs all the necessary information to start the MR AM.- Parameters:
jobConf- the configuration for the MR jobjobSubmitDir- the directory path for the jobts- the security credentials for the job- Returns:
- ApplicationSubmissionContext
- Throws:
IOException- on IO error (e.g. path resolution)
-
setJobPriority
public void setJobPriority(org.apache.hadoop.mapreduce.JobID arg0, String arg1) throws IOException, InterruptedException - Specified by:
setJobPriorityin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getProtocolVersion
- Specified by:
getProtocolVersionin interfaceorg.apache.hadoop.ipc.VersionedProtocol- Throws:
IOException
-
renewDelegationToken
public long renewDelegationToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.mapreduce.security.token.delegation.DelegationTokenIdentifier> arg0) throws IOException, InterruptedException - Specified by:
renewDelegationTokenin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getJobCounters
public org.apache.hadoop.mapreduce.Counters getJobCounters(org.apache.hadoop.mapreduce.JobID arg0) throws IOException, InterruptedException - Specified by:
getJobCountersin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getJobHistoryDir
- Specified by:
getJobHistoryDirin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getJobStatus
public org.apache.hadoop.mapreduce.JobStatus getJobStatus(org.apache.hadoop.mapreduce.JobID jobID) throws IOException, InterruptedException - Specified by:
getJobStatusin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getTaskCompletionEvents
public org.apache.hadoop.mapreduce.TaskCompletionEvent[] getTaskCompletionEvents(org.apache.hadoop.mapreduce.JobID arg0, int arg1, int arg2) throws IOException, InterruptedException - Specified by:
getTaskCompletionEventsin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getTaskDiagnostics
public String[] getTaskDiagnostics(org.apache.hadoop.mapreduce.TaskAttemptID arg0) throws IOException, InterruptedException - Specified by:
getTaskDiagnosticsin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getTaskReports
public org.apache.hadoop.mapreduce.TaskReport[] getTaskReports(org.apache.hadoop.mapreduce.JobID jobID, org.apache.hadoop.mapreduce.TaskType taskType) throws IOException, InterruptedException - Specified by:
getTaskReportsin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
killJob
public void killJob(org.apache.hadoop.mapreduce.JobID arg0) throws IOException, InterruptedException - Specified by:
killJobin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
killTask
public boolean killTask(org.apache.hadoop.mapreduce.TaskAttemptID arg0, boolean arg1) throws IOException, InterruptedException - Specified by:
killTaskin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getQueueAdmins
public org.apache.hadoop.security.authorize.AccessControlList getQueueAdmins(String arg0) throws IOException - Specified by:
getQueueAdminsin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOException
-
getJobTrackerStatus
public org.apache.hadoop.mapreduce.Cluster.JobTrackerStatus getJobTrackerStatus() throws IOException, InterruptedException- Specified by:
getJobTrackerStatusin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOExceptionInterruptedException
-
getProtocolSignature
public org.apache.hadoop.ipc.ProtocolSignature getProtocolSignature(String protocol, long clientVersion, int clientMethodsHash) throws IOException - Specified by:
getProtocolSignaturein interfaceorg.apache.hadoop.ipc.VersionedProtocol- Throws:
IOException
-
getLogFileParams
public org.apache.hadoop.mapreduce.v2.LogParams getLogFileParams(org.apache.hadoop.mapreduce.JobID jobID, org.apache.hadoop.mapreduce.TaskAttemptID taskAttemptID) throws IOException - Specified by:
getLogFileParamsin interfaceorg.apache.hadoop.mapreduce.protocol.ClientProtocol- Throws:
IOException
-
close
- Throws:
IOException
-