@Override public BasicMapReduceTaskContext load(ContextCacheKey key) throws Exception { TaskAttemptID taskAttemptId = key.getTaskAttemptID(); Path txFile = MainOutputCommitter.getTxFile(key.getConfiguration(), taskAttemptId != null ? taskAttemptId.getJobID() : null); FileSystem fs = txFile.getFileSystem(key.getConfiguration()); Transaction transaction = null; if (fs.exists(txFile)) { MapReduceContextConfig contextConfig = new MapReduceContextConfig(key.getConfiguration()); MapReduceClassLoader classLoader = MapReduceClassLoader.getFromConfiguration(key.getConfiguration());
@Override public BasicMapReduceTaskContext load(ContextCacheKey key) throws Exception { TaskAttemptID taskAttemptId = key.getTaskAttemptID(); Path txFile = MainOutputCommitter.getTxFile(key.getConfiguration(), taskAttemptId != null ? taskAttemptId.getJobID() : null); FileSystem fs = txFile.getFileSystem(key.getConfiguration()); Transaction transaction = null; if (fs.exists(txFile)) { MapReduceContextConfig contextConfig = new MapReduceContextConfig(key.getConfiguration()); MapReduceClassLoader classLoader = MapReduceClassLoader.getFromConfiguration(key.getConfiguration());
/** * Returns the {@link BasicMapReduceTaskContext} for the given configuration. Since TaskAttemptContext is not * provided, the returned MapReduceTaskContext will not have Metrics available. * */ public final <K, V> BasicMapReduceTaskContext<K, V> get(Configuration configuration) { return get(new ContextCacheKey(null, configuration)); }
/** * Returns the {@link BasicMapReduceTaskContext} for the given task. */ public final <K, V> BasicMapReduceTaskContext<K, V> get(TaskAttemptContext taskAttemptContext) { return get(new ContextCacheKey(taskAttemptContext)); }
/** * Returns the {@link BasicMapReduceTaskContext} for the given configuration. Since TaskAttemptContext is not * provided, the returned MapReduceTaskContext will not have Metrics available. * */ public final <K, V> BasicMapReduceTaskContext<K, V> get(Configuration configuration) { return get(new ContextCacheKey(null, configuration)); }
/** * Returns the {@link BasicMapReduceTaskContext} for the given task. */ public final <K, V> BasicMapReduceTaskContext<K, V> get(TaskAttemptContext taskAttemptContext) { return get(new ContextCacheKey(taskAttemptContext)); }