public abstract class Task extends Object implements Writable, Configurable
限定符和类型 | 类和说明 |
---|---|
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 |
限定符和类型 | 字段和说明 |
---|---|
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 |
构造器和说明 |
---|
Task() |
Task(String jobFile,
TaskAttemptID taskId,
int partition,
int numSlotsRequired) |
限定符和类型 | 方法和说明 |
---|---|
protected static <INKEY,INVALUE,OUTKEY,OUTVALUE> |
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 . |
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
public Task()
public Task(String jobFile, TaskAttemptID taskId, int partition, int numSlotsRequired)
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
在接口中 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
在接口中 Writable
in
- DataInput
to deseriablize this object from.IOException
public void localizeConfiguration(JobConf conf) throws IOException
IOException
public abstract void run(JobConf job, TaskUmbilicalProtocol umbilical) throws IOException, ClassNotFoundException, InterruptedException
umbilical
- for progress reportsIOException
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
- TODOIOException
public abstract boolean isMapTask()
public Progress getProgress()
public void initialize(JobConf job, JobID id, Reporter reporter, boolean useNewApi) throws 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
protected void statusUpdate(TaskUmbilicalProtocol umbilical) throws IOException
IOException
protected void runTaskCleanupTask(TaskUmbilicalProtocol umbilical, Task.TaskReporter reporter) throws IOException, InterruptedException
protected void runJobCleanupTask(TaskUmbilicalProtocol umbilical, Task.TaskReporter reporter) throws IOException, InterruptedException
protected boolean supportIsolationRunner(JobConf conf)
protected void runJobSetupTask(TaskUmbilicalProtocol umbilical, Task.TaskReporter reporter) throws IOException, InterruptedException
protected static FileSystem.Statistics getFsStatistics(Path path, Configuration conf) throws IOException
path
- the path.IOException
public void setConf(Configuration conf)
Configurable
setConf
在接口中 Configurable
public Configuration getConf()
Configurable
getConf
在接口中 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
Copyright © 2009 The Apache Software Foundation