You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by uncleGen <gi...@git.apache.org> on 2014/09/28 12:57:29 UTC

[GitHub] spark pull request: [SPARK-3712][STREAMING]: add a new UpdateDStre...

GitHub user uncleGen opened a pull request:

    https://github.com/apache/spark/pull/2562

    [SPARK-3712][STREAMING]: add a new UpdateDStream to update a rdd dynamically

    Maybe, we can achieve the aim by using "forEachRdd"  function. But it is weird in this way, because I need to pass a closure, like this:
    
        val baseRdd = ...
        var updatedRDD = ...
        val inputStream = ...
    
        val func = (rdd: RDD[T], t: Time) => {
             updatedRDD = baseRDD.op(rdd)
        }
    
        inputStream.foreachRDD(func _)
    
    In my PR, we can update a rdd like:
    
        val updateStream = inputStream.updateRDD(baseRDD, func).asInstanceOf[U, V, T]
    
    and obtain the updatedRDD like this:
    
        val updatedRDD = updateStream.getUpdatedRDD

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/uncleGen/spark master-clean-14928

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/2562.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2562
    
----
commit 265c941fe1b7cd164eef11c58f622a0c434a229b
Author: uncleGen <hu...@gmail.com>
Date:   2014-09-28T07:48:20Z

    [STREAMING]: add a new UpdateDStream to update a rdd dynamically

commit b5cdb62410c3461115e76a9549f160460b63b8fb
Author: uncleGen <hu...@gmail.com>
Date:   2014-09-28T10:37:40Z

    fix test

commit 41d9a952d39f8bc64a38312856ab57e304a59382
Author: uncleGen <hu...@gmail.com>
Date:   2014-09-28T10:40:37Z

    clerical error

----


---
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


[GitHub] spark pull request: [SPARK-3712][STREAMING]: add a new UpdateDStre...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/2562#issuecomment-57083228
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/20935/


---
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


[GitHub] spark pull request: [SPARK-3712][STREAMING]: add a new UpdateDStre...

Posted by uncleGen <gi...@git.apache.org>.
Github user uncleGen closed the pull request at:

    https://github.com/apache/spark/pull/2562


---
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


[GitHub] spark pull request: [SPARK-3712][STREAMING]: add a new UpdateDStre...

Posted by uncleGen <gi...@git.apache.org>.
Github user uncleGen commented on the pull request:

    https://github.com/apache/spark/pull/2562#issuecomment-57083416
  
    Test failure appears to be unrelated to my patch. 


---
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


[GitHub] spark pull request: [SPARK-3712][STREAMING]: add a new UpdateDStre...

Posted by uncleGen <gi...@git.apache.org>.
Github user uncleGen commented on the pull request:

    https://github.com/apache/spark/pull/2562#issuecomment-57087576
  
    @jerryshao Thanks for your comments! I want to abstract an independent DStream to achieve the aim. I feel it is weird to update a rdd by passing a closure. Maybe, this patch is not very appropriate, I will close it first.


---
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


[GitHub] spark pull request: [SPARK-3712][STREAMING]: add a new UpdateDStre...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2562#issuecomment-57083227
  
      [QA tests have finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/20935/consoleFull) for   PR 2562 at commit [`41d9a95`](https://github.com/apache/spark/commit/41d9a952d39f8bc64a38312856ab57e304a59382).
     * This patch **fails** unit tests.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `class UpdateDStream[U: ClassTag, T: ClassTag, V: ClassTag](`



---
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


[GitHub] spark pull request: [SPARK-3712][STREAMING]: add a new UpdateDStre...

Posted by jerryshao <gi...@git.apache.org>.
Github user jerryshao commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2562#discussion_r18129623
  
    --- Diff: streaming/src/main/scala/org/apache/spark/streaming/dstream/DStream.scala ---
    @@ -602,6 +602,18 @@ abstract class DStream[T: ClassTag] (
       }
     
       /**
    +   * Return a new UpdateDStream in which each RDD is used to update the original rdd by
    +   * applying a function on each RDD of 'this' DStream.
    +   */
    +  def updateRDD[U: ClassTag, V: ClassTag](
    +      rdd: RDD[V],
    +      updateFunc: (Option[RDD[T]], RDD[V]) => RDD[U]
    +    ): DStream[T] = {
    +    val cleanF = ssc.sparkContext.clean(updateFunc)
    +    new UpdateDStream[U, T, V](this, cleanF, rdd).register()
    --- End diff --
    
    Hi @uncleGen , I'm not sure why do you need to register this DStream? looks like your `updateRDD` operator is a transformation DStream, not a action DStream, I don't think you need to call register. It's only for output DStream like `ForEachDStream`.


---
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


[GitHub] spark pull request: [SPARK-3712][STREAMING]: add a new UpdateDStre...

Posted by jerryshao <gi...@git.apache.org>.
Github user jerryshao commented on the pull request:

    https://github.com/apache/spark/pull/2562#issuecomment-57108961
  
    I think we can let TD to decide whether to incorporate this new API. What is your opinion, @tdas ?


---
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


[GitHub] spark pull request: [SPARK-3712][STREAMING]: add a new UpdateDStre...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2562#issuecomment-57082146
  
      [QA tests have started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/20935/consoleFull) for   PR 2562 at commit [`41d9a95`](https://github.com/apache/spark/commit/41d9a952d39f8bc64a38312856ab57e304a59382).
     * This patch merges cleanly.


---
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


[GitHub] spark pull request: [SPARK-3712][STREAMING]: add a new UpdateDStre...

Posted by jerryshao <gi...@git.apache.org>.
Github user jerryshao commented on the pull request:

    https://github.com/apache/spark/pull/2562#issuecomment-57085435
  
    I think this can be done by `foreachRDD` or `transform` as you said, I'm not sure what is your purpose to do so?


---
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