Skip to content
This repository was archived by the owner on Jan 29, 2022. It is now read-only.

Commit 3084708

Browse files
committed
HADOOP-105 Give warning for deprecated single BSON output file
1 parent 1324fc1 commit 3084708

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

core/src/main/java/com/mongodb/hadoop/BSONFileOutputFormat.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public RecordWriter<K, V> getRecordWriter( final TaskAttemptContext context ) th
4141
Configuration conf = context.getConfiguration();
4242
if(conf.get("mapred.output.file") != null){
4343
outPath = new Path(conf.get("mapred.output.file"));
44+
LOG.warn("WARNING: mapred.output.file is deprecated since it only allows one reducer. "
45+
+ "Do not set mapred.output.file. Every reducer will generate data to its own output file.");
4446
}else{
4547
outPath = getDefaultWorkFile(context, ".bson");
4648
}

core/src/main/java/com/mongodb/hadoop/mapred/BSONFileOutputFormat.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public RecordWriter<K, V> getRecordWriter(FileSystem ignored, JobConf job, Strin
3838
Path outPath;
3939
if(job.get("mapred.output.file") != null){
4040
outPath = new Path(job.get("mapred.output.file"));
41+
LOG.warn("WARNING: mapred.output.file is deprecated since it only allows one reducer. "
42+
+ "Do not set mapred.output.file. Every reducer will generate data to its own output file.");
4143
}else{
4244
outPath = getPathForCustomFile(job, name);
4345
}

0 commit comments

Comments
 (0)