@@ -21,10 +21,10 @@ import java.util.concurrent.{ArrayBlockingQueue, TimeUnit}
2121
2222import scala .collection .mutable .ArrayBuffer
2323
24- import org .apache .spark .{SparkException , Logging , SparkConf }
24+ import org .apache .spark .{Logging , SparkConf }
2525import org .apache .spark .storage .StreamBlockId
2626import org .apache .spark .streaming .util .RecurringTimer
27- import org .apache .spark .util .{ SystemClock , Utils }
27+ import org .apache .spark .util .SystemClock
2828
2929/** Listener object for BlockGenerator events */
3030private [streaming] trait BlockGeneratorListener {
@@ -80,10 +80,7 @@ private[streaming] class BlockGenerator(
8080
8181 private val clock = new SystemClock ()
8282 private val blockIntervalMs = conf.getTimeAsMs(" spark.streaming.blockInterval" , " 200ms" )
83- if (blockIntervalMs <= 0 ) {
84- throw new SparkException (s " 'spark.streaming.blockInterval' was set as wrong value " +
85- s " $blockIntervalMs, it must be greater than zero. " )
86- }
83+ require(blockIntervalMs > 0 ,s " 'spark.streaming.blockInterval' should be a positive value " )
8784
8885 private val blockIntervalTimer =
8986 new RecurringTimer (clock, blockIntervalMs, updateCurrentBuffer, " BlockGenerator" )
0 commit comments