[ 
https://issues.apache.org/jira/browse/BAHIR-24?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384868#comment-15384868
 ] 

ASF GitHub Bot commented on BAHIR-24:
-------------------------------------

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

    https://github.com/apache/bahir/pull/10#discussion_r71425100
  
    --- Diff: streaming-mqtt/python/mqtt.py ---
    @@ -38,19 +38,26 @@ def createStream(ssc, brokerUrl, topic,
             :param storageLevel:  RDD storage level.
             :return: A DStream object
             """
    +        jlevel = ssc._sc._getJavaStorageLevel(storageLevel)
    +
             try:
    -            helper = 
ssc._jvm.org.apache.spark.streaming.mqtt.MQTTUtilsPythonHelper()
    -        except TypeError as e:
    -            if str(e) == "'JavaPackage' object is not callable":
    +            helperClass = 
ssc._jvm.java.lang.Thread.currentThread().getContextClassLoader() \
    --- End diff --
    
    After 07cb323e7a128b87ef265ddc66f033365d9de463 in Spark you _should_ be 
able to skip this hack and instead replace with the standard _jvm reference and 
then in your exception replace the search for classnotfoundexception with 
"'JavaPackage' object is not callable" inside of TypeError exception.


> Fix MQTT Python code
> --------------------
>
>                 Key: BAHIR-24
>                 URL: https://issues.apache.org/jira/browse/BAHIR-24
>             Project: Bahir
>          Issue Type: Bug
>          Components: Spark Streaming Connectors
>    Affects Versions: 2.0.0
>            Reporter: Christian Kadner
>            Assignee: Christian Kadner
>   Original Estimate: 12h
>  Remaining Estimate: 12h
>
> When the Bahir project was created from Spark revision {{8301fadd8}} the 
> Python code (incl. examples) were not updated with respect to the modified 
> project structure and test cases were left out from the import.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to