You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by sr...@apache.org on 2015/10/03 13:14:29 UTC
spark git commit: FIX: rememberDuration reassignment error message
Repository: spark
Updated Branches:
refs/heads/master 107320c9b -> be0dcd6eb
FIX: rememberDuration reassignment error message
I was reading throught the scheduler and found this small mistake.
Author: Guillaume Poulin <gu...@hopper.com>
Closes #8966 from gpoulin/remember_duration_typo.
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/be0dcd6e
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/be0dcd6e
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/be0dcd6e
Branch: refs/heads/master
Commit: be0dcd6eb120491bca62d65a11c476401f9932c1
Parents: 107320c
Author: Guillaume Poulin <gu...@hopper.com>
Authored: Sat Oct 3 12:14:00 2015 +0100
Committer: Sean Owen <so...@cloudera.com>
Committed: Sat Oct 3 12:14:00 2015 +0100
----------------------------------------------------------------------
.../org/apache/spark/streaming/DStreamGraph.scala | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/be0dcd6e/streaming/src/main/scala/org/apache/spark/streaming/DStreamGraph.scala
----------------------------------------------------------------------
diff --git a/streaming/src/main/scala/org/apache/spark/streaming/DStreamGraph.scala b/streaming/src/main/scala/org/apache/spark/streaming/DStreamGraph.scala
index 40789c6..ebbcb6b 100644
--- a/streaming/src/main/scala/org/apache/spark/streaming/DStreamGraph.scala
+++ b/streaming/src/main/scala/org/apache/spark/streaming/DStreamGraph.scala
@@ -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
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org