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

    https://github.com/apache/spark/pull/6830#discussion_r32778271
  
    --- 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 --
    
    Java-friendliness. So that there are no issues that can arise when calling 
from python through py4j. This is not meant to be called by public so this is 
sort-of-okay.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to