|
@@ -24,6 +24,7 @@ import java.lang.reflect.Field;
|
|
import java.lang.reflect.InvocationTargetException;
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
|
|
|
import org.apache.hadoop.conf.Configuration;
|
|
import org.apache.hadoop.conf.Configuration;
|
|
|
|
+import org.apache.hadoop.mapreduce.lib.map.WrappedMapper;
|
|
|
|
|
|
/**
|
|
/**
|
|
* A factory to allow applications to deal with inconsistencies between
|
|
* A factory to allow applications to deal with inconsistencies between
|
|
@@ -123,7 +124,7 @@ public class ContextFactory {
|
|
WRAPPED_CONTEXT_FIELD = null;
|
|
WRAPPED_CONTEXT_FIELD = null;
|
|
}
|
|
}
|
|
MAP_CONTEXT_CONSTRUCTOR.setAccessible(true);
|
|
MAP_CONTEXT_CONSTRUCTOR.setAccessible(true);
|
|
- REPORTER_FIELD = taskIOContextCls.getDeclaredField("reporter");
|
|
|
|
|
|
+ REPORTER_FIELD = taskContextCls.getDeclaredField("reporter");
|
|
REPORTER_FIELD.setAccessible(true);
|
|
REPORTER_FIELD.setAccessible(true);
|
|
READER_FIELD = mapContextCls.getDeclaredField("reader");
|
|
READER_FIELD = mapContextCls.getDeclaredField("reader");
|
|
READER_FIELD.setAccessible(true);
|
|
READER_FIELD.setAccessible(true);
|
|
@@ -141,7 +142,8 @@ public class ContextFactory {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Clone a job or task attempt context with a new configuration.
|
|
|
|
|
|
+ * Clone a {@link JobContext} or {@link TaskAttemptContext} with a
|
|
|
|
+ * new configuration.
|
|
* @param original the original context
|
|
* @param original the original context
|
|
* @param conf the new configuration
|
|
* @param conf the new configuration
|
|
* @return a new context object
|
|
* @return a new context object
|
|
@@ -176,7 +178,8 @@ public class ContextFactory {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Copy a mapper context, optionally replacing the input and output.
|
|
|
|
|
|
+ * Copy a custom {@link WrappedMapper.Context}, optionally replacing
|
|
|
|
+ * the input and output.
|
|
* @param <K1> input key type
|
|
* @param <K1> input key type
|
|
* @param <V1> input value type
|
|
* @param <V1> input value type
|
|
* @param <K2> output key type
|
|
* @param <K2> output key type
|