public class ContextFactory extends 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 IOException, InterruptedException
JobContext or TaskAttemptContext with a
new configuration.original - the original contextconf - the new configurationInterruptedExceptionIOExceptionpublic 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 IOException, 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.IOExceptionInterruptedExceptionCopyright © 2008–2022 Apache Software Foundation. All rights reserved.