|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.mapred.Task
public abstract class Task
Base class for tasks. This is NOT a public interface.
Nested Class Summary | |
---|---|
protected static class |
Task.CombineOutputCollector<K,V>
OutputCollector for the combiner. |
protected static class |
Task.CombinerRunner<K,V>
|
protected static class |
Task.CombineValuesIterator<KEY,VALUE>
|
static class |
Task.Counter
|
protected static class |
Task.NewCombinerRunner<K,V>
|
protected static class |
Task.OldCombinerRunner<K,V>
|
protected class |
Task.TaskReporter
|
Field Summary | |
---|---|
protected OutputCommitter |
committer
|
protected JobConf |
conf
|
static long |
DEFAULT_MR_COMBINE_RECORDS_BEFORE_PROGRESS
|
protected static String |
FILESYSTEM_COUNTER_GROUP
Name of the FileSystem counters' group |
protected boolean |
jobCleanup
|
protected JobContext |
jobContext
|
protected JobStatus.State |
jobRunStateForCleanup
|
protected boolean |
jobSetup
|
protected org.apache.hadoop.mapred.JvmContext |
jvmContext
|
protected LocalDirAllocator |
lDirAlloc
|
protected org.apache.hadoop.mapred.MapOutputFile |
mapOutputFile
|
static String |
MR_COMBINE_RECORDS_BEFORE_PROGRESS
|
protected OutputFormat<?,?> |
outputFormat
|
static int |
PROGRESS_INTERVAL
The number of milliseconds between progress reports. |
protected Counters.Counter |
spilledRecordsCounter
|
protected boolean |
taskCleanup
|
protected TaskAttemptContext |
taskContext
|
protected SecretKey |
tokenSecret
|
protected TaskUmbilicalProtocol |
umbilical
|
Constructor Summary | |
---|---|
Task()
|
|
Task(String jobFile,
TaskAttemptID taskId,
int partition,
int numSlotsRequired)
|
Method Summary | ||
---|---|---|
protected static
|
createReduceContext(Reducer<INKEY,INVALUE,OUTKEY,OUTVALUE> reducer,
Configuration job,
TaskAttemptID taskId,
RawKeyValueIterator rIter,
Counter inputKeyCounter,
Counter inputValueCounter,
RecordWriter<OUTKEY,OUTVALUE> output,
OutputCommitter committer,
StatusReporter reporter,
RawComparator<INKEY> comparator,
Class<INKEY> keyClass,
Class<INVALUE> valueClass)
|
|
abstract org.apache.hadoop.mapred.TaskRunner |
createRunner(TaskTracker tracker,
org.apache.hadoop.mapred.TaskTracker.TaskInProgress tip,
org.apache.hadoop.mapred.TaskTracker.RunningJob rjob)
Return an approprate thread runner for this task. |
|
void |
done(TaskUmbilicalProtocol umbilical,
Task.TaskReporter reporter)
|
|
Configuration |
getConf()
Return the configuration used by this object. |
|
protected static String[] |
getFileSystemCounterNames(String uriScheme)
Counters to measure the usage of the different file systems. |
|
protected static FileSystem.Statistics |
getFsStatistics(Path path,
Configuration conf)
Gets a handle to the Statistics instance based on the scheme associated with path. |
|
String |
getJobFile()
|
|
JobID |
getJobID()
Get the job name for this task. |
|
SecretKey |
getJobTokenSecret()
Get the job token secret |
|
org.apache.hadoop.mapred.JvmContext |
getJvmContext()
Gets the task JvmContext |
|
int |
getNumSlotsRequired()
|
|
int |
getPartition()
Get the index of this task within the job. |
|
TaskStatus.Phase |
getPhase()
Return current phase of the task. |
|
Progress |
getProgress()
|
|
org.apache.hadoop.mapred.SortedRanges |
getSkipRanges()
Get skipRanges. |
|
TaskAttemptID |
getTaskID()
|
|
String |
getUser()
Get the name of the user running the job/task. |
|
void |
initialize(JobConf job,
JobID id,
Reporter reporter,
boolean useNewApi)
|
|
abstract boolean |
isMapTask()
|
|
boolean |
isSkipping()
Is Task in skipping mode. |
|
void |
localizeConfiguration(JobConf conf)
Localize the given JobConf to be specific for this task. |
|
void |
readFields(DataInput in)
Deserialize the fields of this object from in . |
|
protected void |
reportFatalError(TaskAttemptID id,
Throwable throwable,
String logMsg)
Report a fatal error to the parent (task) tracker. |
|
protected void |
reportNextRecordRange(TaskUmbilicalProtocol umbilical,
long nextRecIndex)
Reports the next executing record range to TaskTracker. |
|
abstract void |
run(JobConf job,
TaskUmbilicalProtocol umbilical)
Run this task as a part of the named job. |
|
protected void |
runJobCleanupTask(TaskUmbilicalProtocol umbilical,
Task.TaskReporter reporter)
|
|
protected void |
runJobSetupTask(TaskUmbilicalProtocol umbilical,
Task.TaskReporter reporter)
|
|
protected void |
runTaskCleanupTask(TaskUmbilicalProtocol umbilical,
Task.TaskReporter reporter)
|
|
void |
setConf(Configuration conf)
Set the configuration to be used by this object. |
|
void |
setJobFile(String jobFile)
|
|
void |
setJobTokenSecret(SecretKey tokenSecret)
Set the job token secret |
|
void |
setJvmContext(org.apache.hadoop.mapred.JvmContext jvmContext)
Set the task JvmContext |
|
protected void |
setPhase(TaskStatus.Phase phase)
Set current phase of the task. |
|
void |
setSkipping(boolean skipping)
Sets whether to run Task in skipping mode. |
|
void |
setSkipRanges(org.apache.hadoop.mapred.SortedRanges skipRanges)
Set skipRanges. |
|
protected void |
setWriteSkipRecs(boolean writeSkipRecs)
Set whether to write skip records. |
|
protected void |
statusUpdate(TaskUmbilicalProtocol umbilical)
|
|
protected boolean |
supportIsolationRunner(JobConf conf)
|
|
String |
toString()
|
|
protected boolean |
toWriteSkipRecs()
Get whether to write skip records. |
|
void |
write(DataOutput out)
Serialize the fields of this object to out . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String MR_COMBINE_RECORDS_BEFORE_PROGRESS
public static final long DEFAULT_MR_COMBINE_RECORDS_BEFORE_PROGRESS
protected static final String FILESYSTEM_COUNTER_GROUP
protected JobStatus.State jobRunStateForCleanup
protected boolean jobCleanup
protected boolean jobSetup
protected boolean taskCleanup
protected JobConf conf
protected org.apache.hadoop.mapred.MapOutputFile mapOutputFile
protected LocalDirAllocator lDirAlloc
protected JobContext jobContext
protected TaskAttemptContext taskContext
protected OutputFormat<?,?> outputFormat
protected OutputCommitter committer
protected final Counters.Counter spilledRecordsCounter
protected TaskUmbilicalProtocol umbilical
protected SecretKey tokenSecret
protected org.apache.hadoop.mapred.JvmContext jvmContext
public static final int PROGRESS_INTERVAL
Constructor Detail |
---|
public Task()
public Task(String jobFile, TaskAttemptID taskId, int partition, int numSlotsRequired)
Method Detail |
---|
protected static String[] getFileSystemCounterNames(String uriScheme)
public void setJobFile(String jobFile)
public String getJobFile()
public TaskAttemptID getTaskID()
public int getNumSlotsRequired()
public JobID getJobID()
public void setJobTokenSecret(SecretKey tokenSecret)
tokenSecret
- the secretpublic SecretKey getJobTokenSecret()
public void setJvmContext(org.apache.hadoop.mapred.JvmContext jvmContext)
jvmContext
- public org.apache.hadoop.mapred.JvmContext getJvmContext()
public int getPartition()
public TaskStatus.Phase getPhase()
protected void setPhase(TaskStatus.Phase phase)
phase
- task phaseprotected boolean toWriteSkipRecs()
protected void setWriteSkipRecs(boolean writeSkipRecs)
protected void reportFatalError(TaskAttemptID id, Throwable throwable, String logMsg)
public org.apache.hadoop.mapred.SortedRanges getSkipRanges()
public void setSkipRanges(org.apache.hadoop.mapred.SortedRanges skipRanges)
public boolean isSkipping()
public void setSkipping(boolean skipping)
skipping
- public String getUser()
public void write(DataOutput out) throws IOException
Writable
out
.
write
in interface Writable
out
- DataOuput
to serialize this object into.
IOException
public void readFields(DataInput in) throws IOException
Writable
in
.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields
in interface Writable
in
- DataInput
to deseriablize this object from.
IOException
public String toString()
toString
in class Object
public void localizeConfiguration(JobConf conf) throws IOException
IOException
public abstract void run(JobConf job, TaskUmbilicalProtocol umbilical) throws IOException, ClassNotFoundException, InterruptedException
umbilical
- for progress reports
IOException
ClassNotFoundException
InterruptedException
public abstract org.apache.hadoop.mapred.TaskRunner createRunner(TaskTracker tracker, org.apache.hadoop.mapred.TaskTracker.TaskInProgress tip, org.apache.hadoop.mapred.TaskTracker.RunningJob rjob) throws IOException
tip
- TODO
IOException
public abstract boolean isMapTask()
public Progress getProgress()
public void initialize(JobConf job, JobID id, Reporter reporter, boolean useNewApi) throws IOException, ClassNotFoundException, InterruptedException
IOException
ClassNotFoundException
InterruptedException
protected void reportNextRecordRange(TaskUmbilicalProtocol umbilical, long nextRecIndex) throws IOException
umbilical
- nextRecIndex
- the record index which would be fed next.
IOException
public void done(TaskUmbilicalProtocol umbilical, Task.TaskReporter reporter) throws IOException, InterruptedException
IOException
InterruptedException
protected void statusUpdate(TaskUmbilicalProtocol umbilical) throws IOException
IOException
protected void runTaskCleanupTask(TaskUmbilicalProtocol umbilical, Task.TaskReporter reporter) throws IOException, InterruptedException
IOException
InterruptedException
protected void runJobCleanupTask(TaskUmbilicalProtocol umbilical, Task.TaskReporter reporter) throws IOException, InterruptedException
IOException
InterruptedException
protected boolean supportIsolationRunner(JobConf conf)
protected void runJobSetupTask(TaskUmbilicalProtocol umbilical, Task.TaskReporter reporter) throws IOException, InterruptedException
IOException
InterruptedException
protected static FileSystem.Statistics getFsStatistics(Path path, Configuration conf) throws IOException
path
- the path.
IOException
public void setConf(Configuration conf)
Configurable
setConf
in interface Configurable
public Configuration getConf()
Configurable
getConf
in interface Configurable
protected static <INKEY,INVALUE,OUTKEY,OUTVALUE> Reducer.Context createReduceContext(Reducer<INKEY,INVALUE,OUTKEY,OUTVALUE> reducer, Configuration job, TaskAttemptID taskId, RawKeyValueIterator rIter, Counter inputKeyCounter, Counter inputValueCounter, RecordWriter<OUTKEY,OUTVALUE> output, OutputCommitter committer, StatusReporter reporter, RawComparator<INKEY> comparator, Class<INKEY> keyClass, Class<INVALUE> valueClass) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |