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
ClientProtocol
cancelDelegationToken
in interface ClientProtocol
arg0
- the token to cancelIOException
InterruptedException
public TaskTrackerInfo[] getActiveTrackers() throws IOException, InterruptedException
ClientProtocol
getActiveTrackers
in interface ClientProtocol
IOException
InterruptedException
public JobStatus[] getAllJobs() throws IOException, InterruptedException
ClientProtocol
getAllJobs
in interface ClientProtocol
IOException
InterruptedException
public TaskTrackerInfo[] getBlacklistedTrackers() throws IOException, InterruptedException
ClientProtocol
getBlacklistedTrackers
in interface ClientProtocol
IOException
InterruptedException
public ClusterMetrics getClusterMetrics() throws IOException, InterruptedException
ClientProtocol
getClusterMetrics
in interface ClientProtocol
IOException
InterruptedException
public Token<DelegationTokenIdentifier> getDelegationToken(Text renewer) throws IOException, InterruptedException
ClientProtocol
getDelegationToken
in interface ClientProtocol
renewer
- the user other than the creator (if any) that can renew the
tokenIOException
InterruptedException
public String getFilesystemName() throws IOException, InterruptedException
ClientProtocol
getFilesystemName
in interface ClientProtocol
IOException
InterruptedException
public JobID getNewJobID() throws IOException, InterruptedException
ClientProtocol
getNewJobID
in interface ClientProtocol
IOException
InterruptedException
public QueueInfo getQueue(String queueName) throws IOException, InterruptedException
ClientProtocol
getQueue
in interface ClientProtocol
queueName
- Queue NameIOException
InterruptedException
public QueueAclsInfo[] getQueueAclsForCurrentUser() throws IOException, InterruptedException
ClientProtocol
getQueueAclsForCurrentUser
in interface ClientProtocol
IOException
InterruptedException
public QueueInfo[] getQueues() throws IOException, InterruptedException
ClientProtocol
getQueues
in interface ClientProtocol
IOException
InterruptedException
public QueueInfo[] getRootQueues() throws IOException, InterruptedException
ClientProtocol
getRootQueues
in interface ClientProtocol
IOException
InterruptedException
public QueueInfo[] getChildQueues(String parent) throws IOException, InterruptedException
ClientProtocol
getChildQueues
in interface ClientProtocol
IOException
InterruptedException
public String getStagingAreaDir() throws IOException, InterruptedException
ClientProtocol
getStagingAreaDir
in interface ClientProtocol
IOException
InterruptedException
public String getSystemDir() throws IOException, InterruptedException
ClientProtocol
getSystemDir
in interface ClientProtocol
IOException
InterruptedException
public long getTaskTrackerExpiryInterval() throws IOException, InterruptedException
getTaskTrackerExpiryInterval
in interface ClientProtocol
IOException
InterruptedException
public JobStatus submitJob(JobID jobId, String jobSubmitDir, Credentials ts) throws IOException, InterruptedException
ClientProtocol
submitJob
in interface ClientProtocol
IOException
InterruptedException
public ApplicationSubmissionContext createApplicationSubmissionContext(Configuration jobConf, String jobSubmitDir, Credentials ts) throws IOException
IOException
public void setJobPriority(JobID arg0, String arg1) throws IOException, InterruptedException
ClientProtocol
setJobPriority
in interface ClientProtocol
arg0
- ID of the jobarg1
- Priority to be set for the jobIOException
InterruptedException
public long getProtocolVersion(String arg0, long arg1) throws IOException
VersionedProtocol
getProtocolVersion
in interface VersionedProtocol
arg0
- 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
ClientProtocol
renewDelegationToken
in interface ClientProtocol
arg0
- the token to renewIOException
InterruptedException
public Counters getJobCounters(JobID arg0) throws IOException, InterruptedException
ClientProtocol
getJobCounters
in interface ClientProtocol
IOException
InterruptedException
public String getJobHistoryDir() throws IOException, InterruptedException
ClientProtocol
getJobHistoryDir
in interface ClientProtocol
IOException
InterruptedException
public JobStatus getJobStatus(JobID jobID) throws IOException, InterruptedException
ClientProtocol
getJobStatus
in interface ClientProtocol
IOException
InterruptedException
public TaskCompletionEvent[] getTaskCompletionEvents(JobID arg0, int arg1, int arg2) throws IOException, InterruptedException
ClientProtocol
getTaskCompletionEvents
in interface ClientProtocol
arg0
- job idarg1
- event id to start from.arg2
- the max number of events we want to look atIOException
InterruptedException
public String[] getTaskDiagnostics(TaskAttemptID arg0) throws IOException, InterruptedException
ClientProtocol
getTaskDiagnostics
in interface ClientProtocol
arg0
- the id of the taskIOException
InterruptedException
public TaskReport[] getTaskReports(JobID jobID, TaskType taskType) throws IOException, InterruptedException
ClientProtocol
getTaskReports
in interface ClientProtocol
IOException
InterruptedException
public void killJob(JobID arg0) throws IOException, InterruptedException
ClientProtocol
killJob
in interface ClientProtocol
IOException
InterruptedException
public boolean killTask(TaskAttemptID arg0, boolean arg1) throws IOException, InterruptedException
ClientProtocol
killTask
in interface ClientProtocol
arg0
- 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.IOException
InterruptedException
public AccessControlList getQueueAdmins(String arg0) throws IOException
ClientProtocol
getQueueAdmins
in interface ClientProtocol
IOException
public Cluster.JobTrackerStatus getJobTrackerStatus() throws IOException, InterruptedException
ClientProtocol
getJobTrackerStatus
in interface ClientProtocol
Cluster.JobTrackerStatus
of the JobTrackerIOException
InterruptedException
public ProtocolSignature getProtocolSignature(String protocol, long clientVersion, int clientMethodsHash) throws IOException
VersionedProtocol
getProtocolSignature
in interface VersionedProtocol
protocol
- The classname of the protocol interfaceclientVersion
- The version of the protocol that the client speaksclientMethodsHash
- the hashcode of client protocol methodsIOException
for a default implementation
public LogParams getLogFileParams(JobID jobID, TaskAttemptID taskAttemptID) throws IOException
ClientProtocol
getLogFileParams
in interface ClientProtocol
jobID
- the jobId.taskAttemptID
- the taskAttemptId.IOException
Copyright © 2013 Apache Software Foundation. All rights reserved.