You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by oliviertoupin <gi...@git.apache.org> on 2017/07/18 16:32:41 UTC

[GitHub] spark pull request #18672: [kafka010] Fix: On first run DirectKafkaInputDStr...

GitHub user oliviertoupin opened a pull request:

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

    [kafka010] Fix: On first run DirectKafkaInputDStream wasn't using backpressure, it was fetching all records instead.

    ## What changes were proposed in this pull request?
    
    On first run DirectKafkaInputDStream wasn't using backpressure, it was fetching all records instead. Fixed it.
    
    ## How was this patch tested?
    
    Test in dev and production our local build of Spark 2.1.0. Backported to master.
    
    Please review http://spark.apache.org/contributing.html before opening a pull request.


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

    $ git pull https://github.com/oliviertoupin/spark fix-streaming-backbressure

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

    https://github.com/apache/spark/pull/18672.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 #18672
    
----
commit 48615b56c1545837817de89e5925abb18e5edc06
Author: Olivier Toupin <ol...@guavus.com>
Date:   2017-07-18T16:30:15Z

    [kafka010] Fix: On first run DirectKafkaInputDStream wasn't using backpressure, it was fetching all records instead.

----


---
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 issue #18672: [kafka010] Fix: On first run DirectKafkaInputDStream was...

Posted by gaborgsomogyi <gi...@git.apache.org>.
Github user gaborgsomogyi commented on the issue:

    https://github.com/apache/spark/pull/18672
  
    Looks like a shortcut to me as well.
    There is already a PR for backpressure:
    https://github.com/apache/spark/pull/19431
    
    Could you explain what exactly would like to achieve here?



---

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


[GitHub] spark issue #18672: [kafka010] Fix: On first run DirectKafkaInputDStream was...

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

    https://github.com/apache/spark/pull/18672
  
    Can one of the admins verify this patch?


---

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


[GitHub] spark pull request #18672: [kafka010] Fix: On first run DirectKafkaInputDStr...

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

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


---

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


[GitHub] spark issue #18672: [kafka010] Fix: On first run DirectKafkaInputDStream was...

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

    https://github.com/apache/spark/pull/18672
  
    Can one of the admins verify this patch?


---

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


[GitHub] spark pull request #18672: [kafka010] Fix: On first run DirectKafkaInputDStr...

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

    https://github.com/apache/spark/pull/18672#discussion_r128073513
  
    --- Diff: external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/DirectKafkaInputDStream.scala ---
    @@ -130,8 +130,15 @@ private[spark] class DirectKafkaInputDStream[K, V](
         offsets: Map[TopicPartition, Long]): Option[Map[TopicPartition, Long]] = {
         val estimatedRateLimit = rateController.map(_.getLatestRate())
     
    +    // TODO: Fix in rate controller (need SparkConf or initial rate member value)
    +    // Fix: Rate controller first value is -1, if -1 return use the default rate
    +    val fixedEstimatedRateLimit = estimatedRateLimit match {
    --- End diff --
    
    This looks like a bit of a hack. Can you explain this? what's the right fix if so?
    See http://spark.apache.org/contributing.html too


---
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 issue #18672: [kafka010] Fix: On first run DirectKafkaInputDStream was...

Posted by oliviertoupin <gi...@git.apache.org>.
Github user oliviertoupin commented on the issue:

    https://github.com/apache/spark/pull/18672
  
    My PR predate #19431, but essentially fix the same issue. Since #19431 have more traction and is more thorough, I'll close this one, and comment on the new one if necessary.


---

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


[GitHub] spark pull request #18672: [kafka010] Fix: On first run DirectKafkaInputDStr...

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

    https://github.com/apache/spark/pull/18672#discussion_r130169031
  
    --- Diff: external/kafka-0-10/src/main/scala/org/apache/spark/streaming/kafka010/DirectKafkaInputDStream.scala ---
    @@ -130,8 +130,15 @@ private[spark] class DirectKafkaInputDStream[K, V](
         offsets: Map[TopicPartition, Long]): Option[Map[TopicPartition, Long]] = {
         val estimatedRateLimit = rateController.map(_.getLatestRate())
     
    +    // TODO: Fix in rate controller (need SparkConf or initial rate member value)
    +    // Fix: Rate controller first value is -1, if -1 return use the default rate
    +    val fixedEstimatedRateLimit = estimatedRateLimit match {
    --- End diff --
    
    Not so much of a hack, but limit reusability. The best place would be directly in the RateEstimator, but we don't have access to the "spark.streaming.backpressure.initialRate".


---
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 issue #18672: [kafka010] Fix: On first run DirectKafkaInputDStream was...

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

    https://github.com/apache/spark/pull/18672
  
    Can one of the admins verify this 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