Merge pull request #1179 from himanshug/batch_ingest_no_data

fail early if there is no input data found for batch hadoop indexing
This commit is contained in:
Fangjin Yang 2015-03-07 11:00:52 -08:00
commit 88a1d1e048
1 changed files with 5 additions and 1 deletions

View File

@ -169,7 +169,11 @@ public class IndexGeneratorJob implements Jobby
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);