From 963682d69681691f39dbe047905929b9fe4bd9af Mon Sep 17 00:00:00 2001 From: nishant Date: Wed, 10 Jun 2015 21:38:34 +0530 Subject: [PATCH] Add check for valid rowFlushBoundary configuration and fix tests --- .../main/java/io/druid/indexing/common/task/IndexTask.java | 1 + .../java/io/druid/indexing/common/task/TaskSerdeTest.java | 2 +- .../java/io/druid/indexing/overlord/TaskLifecycleTest.java | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/indexing-service/src/main/java/io/druid/indexing/common/task/IndexTask.java b/indexing-service/src/main/java/io/druid/indexing/common/task/IndexTask.java index 8919bc179e4..13ffcbeb41b 100644 --- a/indexing-service/src/main/java/io/druid/indexing/common/task/IndexTask.java +++ b/indexing-service/src/main/java/io/druid/indexing/common/task/IndexTask.java @@ -501,6 +501,7 @@ public class IndexTask extends AbstractFixedIntervalTask ) { this.targetPartitionSize = targetPartitionSize == 0 ? DEFAULT_TARGET_PARTITION_SIZE : targetPartitionSize; + Preconditions.checkArgument(rowFlushBoundary >= 0, "rowFlushBoundary should be positive or zero"); this.rowFlushBoundary = rowFlushBoundary == 0 ? DEFAULT_ROW_FLUSH_BOUNDARY : rowFlushBoundary; this.numShards = numShards == null ? -1 : numShards; this.indexSpec = indexSpec == null ? DEFAULT_INDEX_SPEC : indexSpec; diff --git a/indexing-service/src/test/java/io/druid/indexing/common/task/TaskSerdeTest.java b/indexing-service/src/test/java/io/druid/indexing/common/task/TaskSerdeTest.java index 76702c8de62..0c2822fe20c 100644 --- a/indexing-service/src/test/java/io/druid/indexing/common/task/TaskSerdeTest.java +++ b/indexing-service/src/test/java/io/druid/indexing/common/task/TaskSerdeTest.java @@ -75,7 +75,7 @@ public class TaskSerdeTest ) ), new IndexTask.IndexIOConfig(new LocalFirehoseFactory(new File("lol"), "rofl", null)), - new IndexTask.IndexTuningConfig(10000, -1, -1, indexSpec) + new IndexTask.IndexTuningConfig(10000, 10, -1, indexSpec) ), jsonMapper ); diff --git a/indexing-service/src/test/java/io/druid/indexing/overlord/TaskLifecycleTest.java b/indexing-service/src/test/java/io/druid/indexing/overlord/TaskLifecycleTest.java index 4c501e5f347..bb2971b98fc 100644 --- a/indexing-service/src/test/java/io/druid/indexing/overlord/TaskLifecycleTest.java +++ b/indexing-service/src/test/java/io/druid/indexing/overlord/TaskLifecycleTest.java @@ -364,7 +364,7 @@ public class TaskLifecycleTest IR("2010-01-02T01", "a", "c", 1) ) )), - new IndexTask.IndexTuningConfig(10000, -1, -1, indexSpec)), + new IndexTask.IndexTuningConfig(10000, 10, -1, indexSpec)), TestUtils.MAPPER ); @@ -418,7 +418,7 @@ public class TaskLifecycleTest ) ), new IndexTask.IndexIOConfig(newMockExceptionalFirehoseFactory()), - new IndexTask.IndexTuningConfig(10000, -1, -1, indexSpec) + new IndexTask.IndexTuningConfig(10000, 10, -1, indexSpec) ), TestUtils.MAPPER );