public class ContextFactory
extends java.lang.Object
| Constructor and Description |
|---|
ContextFactory() |
| Modifier and Type | Method and Description |
|---|---|
static JobContext |
cloneContext(JobContext original,
org.apache.hadoop.conf.Configuration conf)
Clone a
JobContext or TaskAttemptContext with a
new configuration. |
static <K1,V1,K2,V2> |
cloneMapContext(MapContext<K1,V1,K2,V2> context,
org.apache.hadoop.conf.Configuration conf,
RecordReader<K1,V1> reader,
RecordWriter<K2,V2> writer)
Copy a custom WrappedMapper.Context, optionally replacing
the input and output.
|
public static JobContext cloneContext(JobContext original, org.apache.hadoop.conf.Configuration conf) throws java.io.IOException, java.lang.InterruptedException
JobContext or TaskAttemptContext with a
new configuration.original - the original contextconf - the new configurationjava.lang.InterruptedExceptionjava.io.IOExceptionpublic static <K1,V1,K2,V2> Mapper.Context cloneMapContext(MapContext<K1,V1,K2,V2> context, org.apache.hadoop.conf.Configuration conf, RecordReader<K1,V1> reader, RecordWriter<K2,V2> writer) throws java.io.IOException, java.lang.InterruptedException
K1 - input key typeV1 - input value typeK2 - output key typeV2 - output value typecontext - the context to cloneconf - a new configurationreader - Reader to read from. Null means to clone from context.writer - Writer to write to. Null means to clone from context.java.io.IOExceptionjava.lang.InterruptedExceptionCopyright © 2009 The Apache Software Foundation