org.apache.hadoop.mapred
Class JobClient

java.lang.Object
  extended byorg.apache.hadoop.mapred.JobClient
All Implemented Interfaces:
org.apache.hadoop.mapred.MRConstants

public class JobClient
extends Object
implements org.apache.hadoop.mapred.MRConstants

JobClient interacts with the JobTracker network interface. This object implements the job-control interface, and should be the primary method by which user programs interact with the networked job system.

Author:
Mike Cafarella

Field Summary
static int FILE_NOT_FOUND
           
static long HEARTBEAT_INTERVAL
           
static int SUCCESS
           
static long TASKTRACKER_EXPIRY_INTERVAL
           
 
Constructor Summary
JobClient(Configuration conf)
          Build a job client, connect to the default job tracker
JobClient(InetSocketAddress jobTrackAddr, Configuration conf)
          Build a job client, connect to the indicated job tracker.
 
Method Summary
 void close()
           
 ClusterStatus getClusterStatus()
           
 FileSystem getFs()
          Get a filesystem handle.
 RunningJob getJob(String jobid)
          Get an RunningJob object to track an ongoing job.
static void main(String[] argv)
           
static void runJob(JobConf job)
          Utility that submits a job, then polls for progress until the job is complete.
 RunningJob submitJob(JobConf job)
          Submit a job to the MR system
 RunningJob submitJob(String jobFile)
          Submit a job to the MR system
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEARTBEAT_INTERVAL

public static final long HEARTBEAT_INTERVAL
See Also:
Constant Field Values

TASKTRACKER_EXPIRY_INTERVAL

public static final long TASKTRACKER_EXPIRY_INTERVAL
See Also:
Constant Field Values

SUCCESS

public static final int SUCCESS
See Also:
Constant Field Values

FILE_NOT_FOUND

public static final int FILE_NOT_FOUND
See Also:
Constant Field Values
Constructor Detail

JobClient

public JobClient(Configuration conf)
          throws IOException
Build a job client, connect to the default job tracker


JobClient

public JobClient(InetSocketAddress jobTrackAddr,
                 Configuration conf)
          throws IOException
Build a job client, connect to the indicated job tracker.

Method Detail

close

public void close()
           throws IOException
Throws:
IOException

getFs

public FileSystem getFs()
                 throws IOException
Get a filesystem handle. We need this to prepare jobs for submission to the MapReduce system.

Throws:
IOException

submitJob

public RunningJob submitJob(String jobFile)
                     throws IOException
Submit a job to the MR system

Throws:
IOException

submitJob

public RunningJob submitJob(JobConf job)
                     throws IOException
Submit a job to the MR system

Throws:
IOException

getJob

public RunningJob getJob(String jobid)
                  throws IOException
Get an RunningJob object to track an ongoing job. Returns null if the id does not correspond to any known job.

Throws:
IOException

getClusterStatus

public ClusterStatus getClusterStatus()
                               throws IOException
Throws:
IOException

runJob

public static void runJob(JobConf job)
                   throws IOException
Utility that submits a job, then polls for progress until the job is complete.

Throws:
IOException

main

public static void main(String[] argv)
                 throws IOException
Throws:
IOException


Copyright © 2006 The Apache Software Foundation