Skip to content
Snippets Groups Projects
Commit be0dcd6e authored by Guillaume Poulin's avatar Guillaume Poulin Committed by Sean Owen
Browse files

FIX: rememberDuration reassignment error message

I was reading throught the scheduler and found this small mistake.

Author: Guillaume Poulin <guillaume@hopper.com>

Closes #8966 from gpoulin/remember_duration_typo.
parent 107320c9
No related branches found
No related tags found
No related merge requests found
......@@ -38,9 +38,7 @@ final private[streaming] class DStreamGraph extends Serializable with Logging {
def start(time: Time) {
this.synchronized {
if (zeroTime != null) {
throw new Exception("DStream graph computation already started")
}
require(zeroTime == null, "DStream graph computation already started")
zeroTime = time
startTime = time
outputStreams.foreach(_.initialize(zeroTime))
......@@ -68,20 +66,16 @@ final private[streaming] class DStreamGraph extends Serializable with Logging {
def setBatchDuration(duration: Duration) {
this.synchronized {
if (batchDuration != null) {
throw new Exception("Batch duration already set as " + batchDuration +
". cannot set it again.")
}
require(batchDuration == null,
s"Batch duration already set as $batchDuration. Cannot set it again.")
batchDuration = duration
}
}
def remember(duration: Duration) {
this.synchronized {
if (rememberDuration != null) {
throw new Exception("Remember duration already set as " + batchDuration +
". cannot set it again.")
}
require(rememberDuration == null,
s"Remember duration already set as $rememberDuration. Cannot set it again.")
rememberDuration = duration
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment