Github user harishreedharan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6830#discussion_r32771292
  
    --- Diff: 
external/flume/src/main/scala/org/apache/spark/streaming/flume/FlumeUtils.scala 
---
    @@ -236,3 +242,71 @@ object FlumeUtils {
         createPollingStream(jssc.ssc, addresses, storageLevel, maxBatchSize, 
parallelism)
       }
     }
    +
    +/**
    + * This is a helper class that wraps the methods in FlumeUtils into more 
Python-friendly class and
    + * function so that it can be easily instantiated and called from Python's 
FlumeUtils.
    + */
    +private class FlumeUtilsPythonHelper {
    +
    +  def createStream(
    +      jssc: JavaStreamingContext,
    +      hostname: String,
    +      port: Int,
    +      storageLevel: StorageLevel,
    +      enableDecompression: Boolean
    +    ): JavaPairDStream[Array[Byte], Array[Byte]] = {
    +    val dstream = FlumeUtils.createStream(jssc, hostname, port, 
storageLevel, enableDecompression)
    +    FlumeUtilsPythonHelper.toDStreamForPython(dstream)
    +  }
    +
    +  def createPollingStream(
    +      jssc: JavaStreamingContext,
    +      hosts: JList[String],
    +      ports: JList[Int],
    --- End diff --
    
    This is not very intuitive. Why not take a list of (host, port) tuples? Is 
there an issue passing tuples from Python?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to