|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.mapred.JobTracker
public class JobTracker
JobTracker is the central location for submitting and tracking MR jobs in a network environment.
Nested Class Summary | |
---|---|
static class |
JobTracker.IllegalStateException
A client tried to submit a job before the Job Tracker was ready. |
static class |
JobTracker.State
|
Field Summary | |
---|---|
static int |
CLUSTER_INCREMENT
|
static long |
COUNTER_UPDATE_INTERVAL
|
static int |
FILE_NOT_FOUND
|
static int |
HEARTBEAT_INTERVAL_MIN
|
static org.apache.commons.logging.Log |
LOG
|
static String |
MAP_OUTPUT_LENGTH
The custom http header used for the map output length. |
static float |
MAX_INMEM_FILESIZE_FRACTION
Constant denoting the max size (in terms of the fraction of the total size of the filesys) of a map output file that we will try to keep in mem. |
static float |
MAX_INMEM_FILESYS_USE
Constant denoting when a merge of in memory files will be triggered |
static int |
SUCCESS
|
static String |
TEMP_DIR_NAME
Temporary directory name |
static int |
TRACKERS_OK
|
static int |
UNKNOWN_TASKTRACKER
|
static long |
versionID
version 3 introduced to replace emitHearbeat/pollForNewTask/pollForTaskWithClosedJob with heartbeat(TaskTrackerStatus, boolean, boolean, short)
version 4 changed TaskReport for HADOOP-549. |
Fields inherited from interface org.apache.hadoop.mapred.JobSubmissionProtocol |
---|
versionID |
Method Summary | |
---|---|
Vector<org.apache.hadoop.mapred.JobInProgress> |
completedJobs()
|
Vector<org.apache.hadoop.mapred.JobInProgress> |
failedJobs()
|
static InetSocketAddress |
getAddress(Configuration conf)
|
JobStatus[] |
getAllJobs()
Get all the jobs submitted. |
String |
getAssignedTracker(String taskId)
Get tracker name for a given task id. |
ClusterStatus |
getClusterStatus()
Get the current status of the cluster |
String |
getFilesystemName()
Grab the local fs name |
int |
getInfoPort()
|
org.apache.hadoop.mapred.JobInProgress |
getJob(String jobid)
|
Counters |
getJobCounters(String jobid)
Grab the current job counters |
JobProfile |
getJobProfile(String jobid)
Grab a handle to a job that is already known to the JobTracker. |
JobStatus |
getJobStatus(String jobid)
Grab a handle to a job that is already known to the JobTracker. |
String |
getJobTrackerMachine()
|
static String |
getLocalJobFilePath(String jobId)
Get the localized job file path on the job trackers local file system |
TaskReport[] |
getMapTaskReports(String jobid)
Grab a bunch of info on the map tasks that make up the job |
String |
getNewJobId()
Allocates a new JobId string. |
Node |
getNode(String name)
Return the Node in the network topology that corresponds to the hostname |
Collection<Node> |
getNodesAtMaxLevel()
Returns a collection of nodes at the max level |
int |
getNumResolvedTaskTrackers()
|
int |
getNumTaskCacheLevels()
|
static Node |
getParentNode(Node node,
int level)
|
long |
getProtocolVersion(String protocol,
long clientVersion)
Return protocol version corresponding to protocol interface. |
TaskReport[] |
getReduceTaskReports(String jobid)
Grab a bunch of info on the reduce tasks that make up the job |
List<org.apache.hadoop.mapred.JobInProgress> |
getRunningJobs()
Version that is called from a timer thread, and therefore needs to be careful to synchronize. |
long |
getStartTime()
|
TaskCompletionEvent[] |
getTaskCompletionEvents(String jobid,
int fromEventId,
int maxEvents)
Get task completion events for the jobid, starting from fromEventId. |
String[] |
getTaskDiagnostics(String jobId,
String tipId,
String taskId)
Get the diagnostics for a given task |
org.apache.hadoop.mapred.TaskTrackerStatus |
getTaskTracker(String trackerID)
|
int |
getTotalSubmissions()
|
String |
getTrackerIdentifier()
Get the unique identifier (ie. |
int |
getTrackerPort()
|
org.apache.hadoop.mapred.HeartbeatResponse |
heartbeat(org.apache.hadoop.mapred.TaskTrackerStatus status,
boolean initialContact,
boolean acceptNewTasks,
short responseId)
The periodic heartbeat mechanism between the TaskTracker and
the JobTracker . |
JobStatus[] |
jobsToComplete()
Get the jobs that are not completed and not failed |
void |
killJob(String jobid)
Kill the indicated job |
boolean |
killTask(String taskid,
boolean shouldFail)
Mark a Task to be killed |
static void |
main(String[] argv)
Start the JobTracker process. |
void |
offerService()
Run forever |
void |
reportTaskTrackerError(String taskTracker,
String errorClass,
String errorMessage)
Report a problem to the job tracker. |
Node |
resolveAndAddToTopology(String name)
|
Vector<org.apache.hadoop.mapred.JobInProgress> |
runningJobs()
|
static JobTracker |
startTracker(JobConf conf)
Start the JobTracker with given configuration. |
void |
stopTracker()
|
JobStatus |
submitJob(String jobId)
JobTracker.submitJob() kicks off a new job. |
Collection |
taskTrackers()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.commons.logging.Log LOG
public static final int HEARTBEAT_INTERVAL_MIN
public static final int CLUSTER_INCREMENT
public static final long COUNTER_UPDATE_INTERVAL
public static final float MAX_INMEM_FILESYS_USE
public static final float MAX_INMEM_FILESIZE_FRACTION
public static final int SUCCESS
public static final int FILE_NOT_FOUND
public static final String MAP_OUTPUT_LENGTH
public static final String TEMP_DIR_NAME
public static final long versionID
heartbeat(TaskTrackerStatus, boolean, boolean, short)
version 4 changed TaskReport for HADOOP-549.
version 5 introduced that removes locateMapOutputs and instead uses
getTaskCompletionEvents to figure finished maps and fetch the outputs
version 6 adds maxTasks to TaskTrackerStatus for HADOOP-1245
version 7 replaces maxTasks by maxMapTasks and maxReduceTasks in
TaskTrackerStatus for HADOOP-1274
Version 8: HeartbeatResponse is added with the next heartbeat interval.
version 9 changes the counter representation for HADOOP-2248
version 10 changes the TaskStatus representation for HADOOP-2208
public static final int TRACKERS_OK
public static final int UNKNOWN_TASKTRACKER
Method Detail |
---|
public static JobTracker startTracker(JobConf conf) throws IOException, InterruptedException
zero
.
conf
- configuration for the JobTracker.
IOException
InterruptedException
public void stopTracker() throws IOException
IOException
public long getProtocolVersion(String protocol, long clientVersion) throws IOException
VersionedProtocol
getProtocolVersion
in interface VersionedProtocol
protocol
- The classname of the protocol interfaceclientVersion
- The version of the protocol that the client speaks
IOException
public static InetSocketAddress getAddress(Configuration conf)
public void offerService() throws InterruptedException
InterruptedException
public int getTotalSubmissions()
public String getJobTrackerMachine()
public String getTrackerIdentifier()
public int getTrackerPort()
public int getInfoPort()
public long getStartTime()
public Vector<org.apache.hadoop.mapred.JobInProgress> runningJobs()
public List<org.apache.hadoop.mapred.JobInProgress> getRunningJobs()
public Vector<org.apache.hadoop.mapred.JobInProgress> failedJobs()
public Vector<org.apache.hadoop.mapred.JobInProgress> completedJobs()
public Collection taskTrackers()
public org.apache.hadoop.mapred.TaskTrackerStatus getTaskTracker(String trackerID)
public Node resolveAndAddToTopology(String name)
public Collection<Node> getNodesAtMaxLevel()
public static Node getParentNode(Node node, int level)
public Node getNode(String name)
public int getNumTaskCacheLevels()
public int getNumResolvedTaskTrackers()
public org.apache.hadoop.mapred.HeartbeatResponse heartbeat(org.apache.hadoop.mapred.TaskTrackerStatus status, boolean initialContact, boolean acceptNewTasks, short responseId) throws IOException
TaskTracker
and
the JobTracker
.
The JobTracker
processes the status information sent by the
TaskTracker
and responds with instructions to start/stop
tasks or jobs, and also 'reset' instructions during contingencies.
status
- the status updateinitialContact
- true
if this is first interaction since
'refresh', false
otherwise.acceptNewTasks
- true
if the TaskTracker
is
ready to accept new tasks to run.responseId
- the last responseId successfully acted upon by the
TaskTracker
.
HeartbeatResponse
with
fresh instructions.
IOException
public String getFilesystemName() throws IOException
getFilesystemName
in interface JobSubmissionProtocol
IOException
public void reportTaskTrackerError(String taskTracker, String errorClass, String errorMessage) throws IOException
taskTracker
- the name of the task trackererrorClass
- the kind of error (eg. the class that was thrown)errorMessage
- the human readable error message
IOException
- if there was a problem in communication or on the
remote sidepublic String getNewJobId() throws IOException
getNewJobId
in interface JobSubmissionProtocol
IOException
public JobStatus submitJob(String jobId) throws IOException
submitJob
in interface JobSubmissionProtocol
IOException
public ClusterStatus getClusterStatus()
JobSubmissionProtocol
getClusterStatus
in interface JobSubmissionProtocol
public void killJob(String jobid)
JobSubmissionProtocol
killJob
in interface JobSubmissionProtocol
public JobProfile getJobProfile(String jobid)
JobSubmissionProtocol
getJobProfile
in interface JobSubmissionProtocol
public JobStatus getJobStatus(String jobid)
JobSubmissionProtocol
getJobStatus
in interface JobSubmissionProtocol
public Counters getJobCounters(String jobid)
JobSubmissionProtocol
getJobCounters
in interface JobSubmissionProtocol
public TaskReport[] getMapTaskReports(String jobid)
JobSubmissionProtocol
getMapTaskReports
in interface JobSubmissionProtocol
public TaskReport[] getReduceTaskReports(String jobid)
JobSubmissionProtocol
getReduceTaskReports
in interface JobSubmissionProtocol
public TaskCompletionEvent[] getTaskCompletionEvents(String jobid, int fromEventId, int maxEvents) throws IOException
getTaskCompletionEvents
in interface JobSubmissionProtocol
jobid
- job idfromEventId
- event id to start from.maxEvents
- the max number of events we want to look at
IOException
public String[] getTaskDiagnostics(String jobId, String tipId, String taskId) throws IOException
getTaskDiagnostics
in interface JobSubmissionProtocol
jobId
- the id of the jobtipId
- the id of the tiptaskId
- the id of the task
IOException
public boolean killTask(String taskid, boolean shouldFail) throws IOException
killTask
in interface JobSubmissionProtocol
taskid
- the id of the task to kill.shouldFail
- if true the task is failed and added to failed tasks list, otherwise
it is just killed, w/o affecting job failure status.
IOException
public String getAssignedTracker(String taskId)
taskId
- the name of the task
public JobStatus[] jobsToComplete()
JobSubmissionProtocol
jobsToComplete
in interface JobSubmissionProtocol
public JobStatus[] getAllJobs()
JobSubmissionProtocol
getAllJobs
in interface JobSubmissionProtocol
public org.apache.hadoop.mapred.JobInProgress getJob(String jobid)
public static String getLocalJobFilePath(String jobId)
jobId
- id of the job
public static void main(String[] argv) throws IOException, InterruptedException
IOException
InterruptedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |