Skip to content

Commit

Permalink
fail early if there is no input data for batch hadoop indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshug committed Mar 7, 2015
1 parent a54f93e commit 6a0405d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ public boolean run()

SortableBytes.useSortableBytesAsMapOutputKey(job);

job.setNumReduceTasks(Iterables.size(config.getAllBuckets().get()));
int numReducers = Iterables.size(config.getAllBuckets().get());
if(numReducers == 0) {
throw new RuntimeException("No buckets?? seems there is no data to index.");
}
job.setNumReduceTasks(numReducers);
job.setPartitionerClass(IndexGeneratorPartitioner.class);

setReducerClass(job);
Expand Down

0 comments on commit 6a0405d

Please sign in to comment.