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 { ...@@ -38,9 +38,7 @@ final private[streaming] class DStreamGraph extends Serializable with Logging {
def start(time: Time) { def start(time: Time) {
this.synchronized { this.synchronized {
if (zeroTime != null) { require(zeroTime == null, "DStream graph computation already started")
throw new Exception("DStream graph computation already started")
}
zeroTime = time zeroTime = time
startTime = time startTime = time
outputStreams.foreach(_.initialize(zeroTime)) outputStreams.foreach(_.initialize(zeroTime))
...@@ -68,20 +66,16 @@ final private[streaming] class DStreamGraph extends Serializable with Logging { ...@@ -68,20 +66,16 @@ final private[streaming] class DStreamGraph extends Serializable with Logging {
def setBatchDuration(duration: Duration) { def setBatchDuration(duration: Duration) {
this.synchronized { this.synchronized {
if (batchDuration != null) { require(batchDuration == null,
throw new Exception("Batch duration already set as " + batchDuration + s"Batch duration already set as $batchDuration. Cannot set it again.")
". cannot set it again.")
}
batchDuration = duration batchDuration = duration
} }
} }
def remember(duration: Duration) { def remember(duration: Duration) {
this.synchronized { this.synchronized {
if (rememberDuration != null) { require(rememberDuration == null,
throw new Exception("Remember duration already set as " + batchDuration + s"Remember duration already set as $rememberDuration. Cannot set it again.")
". cannot set it again.")
}
rememberDuration = duration 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