spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pwendell <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-7530][STREAMING] Added StreamingContext...
Date Mon, 11 May 2015 23:48:54 GMT
Github user pwendell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6058#discussion_r30093708
  
    --- Diff: streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala ---
    @@ -513,22 +507,31 @@ class StreamingContext private[streaming] (
       }
     
       /**
    +   * Return the current state of the context.
    +   */
    +  def getState(): StreamingContextState = {
    +    state
    +  }
    +
    +  /**
        * Start the execution of the streams.
        *
        * @throws SparkException if the context has already been started or stopped.
        */
       def start(): Unit = synchronized {
    -    if (state == Started) {
    -      throw new SparkException("StreamingContext has already been started")
    -    }
    -    if (state == Stopped) {
    -      throw new SparkException("StreamingContext has already been stopped")
    +    state match {
    +      case INITIALIZED =>
    +        // good to start
    +      case STARTED =>
    --- End diff --
    
    Should we call this `RUNNING` or `ACTIVE`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message