clarify error messaging for parallel indexing task when when missing numShards or intervals (#8513)

This commit is contained in:
Clint Wylie 2019-09-11 20:47:27 -07:00 committed by Fangjin Yang
parent 1498250204
commit b00dd84fa2
2 changed files with 10 additions and 11 deletions

View File

@ -183,13 +183,14 @@ public class ParallelIndexSupervisorTask extends AbstractBatchIndexTask implemen
throw new IAE("[%s] should implement FiniteFirehoseFactory", firehoseFactory.getClass().getSimpleName()); throw new IAE("[%s] should implement FiniteFirehoseFactory", firehoseFactory.getClass().getSimpleName());
} }
if (ingestionSchema.getTuningConfig().isForceGuaranteedRollup() if (ingestionSchema.getTuningConfig().isForceGuaranteedRollup()) {
&& (ingestionSchema.getTuningConfig().getNumShards() == null if (ingestionSchema.getTuningConfig().getNumShards() == null) {
|| ingestionSchema.getDataSchema().getGranularitySpec().inputIntervals().isEmpty())) { throw new ISE("forceGuaranteedRollup is set but numShards is missing in partitionsSpec");
throw new ISE( }
"forceGuaranteedRollup is set "
+ "but numShards is missing in partitionsSpec or intervals is missing in granularitySpec" if (ingestionSchema.getDataSchema().getGranularitySpec().inputIntervals().isEmpty()) {
); throw new ISE("forceGuaranteedRollup is set but intervals is missing in granularitySpec");
}
} }
this.baseFirehoseFactory = (FiniteFirehoseFactory) firehoseFactory; this.baseFirehoseFactory = (FiniteFirehoseFactory) firehoseFactory;

View File

@ -159,8 +159,7 @@ public class MultiPhaseParallelIndexingTest extends AbstractParallelIndexSupervi
{ {
expectedException.expect(IllegalStateException.class); expectedException.expect(IllegalStateException.class);
expectedException.expectMessage( expectedException.expectMessage(
"forceGuaranteedRollup is set but numShards is missing in partitionsSpec " "forceGuaranteedRollup is set but intervals is missing in granularitySpec"
+ "or intervals is missing in granularitySpec"
); );
newTask( newTask(
null, null,
@ -177,8 +176,7 @@ public class MultiPhaseParallelIndexingTest extends AbstractParallelIndexSupervi
{ {
expectedException.expect(IllegalStateException.class); expectedException.expect(IllegalStateException.class);
expectedException.expectMessage( expectedException.expectMessage(
"forceGuaranteedRollup is set but numShards is missing in partitionsSpec " "forceGuaranteedRollup is set but numShards is missing in partitionsSpec"
+ "or intervals is missing in granularitySpec"
); );
newTask( newTask(
Intervals.of("2017/2018"), Intervals.of("2017/2018"),