我成功地遵循了 DAVID TAIEB 的这个很棒的教程。问题是图表需要很长时间才能改变。它大约需要几分钟,而不是几秒钟,因为它应该是!
可能是什么问题呢 ?
当我在 Scala Notebook 中运行这个单元格时:
demo.startTwitterStreaming(sc)
输出如下所示:
Registering JaasConfiguration: /tmp/1sFcnUVoabfuBAyF/jaas.conf
Setting hadoop configuration for swift container
https://kafka-rest-prod01.messagehub.services.us-south.bluemix.net:443/admin/topics
https://kafka-rest-prod01.messagehub.services.us-south.bluemix.net:443/admin/topics
default location of ssl Trust store is: /usr/local/src/spark160master/ibm-java-x86_64-80/jre/lib/security/cacerts
Twitter stream started
Tweets are collected real-time and analyzed
To stop the streaming and start interacting with the data use: StreamingTwitter.stopTwitterStreaming
Receiver Started: KafkaReceiver-0
Batch started with 0 records
-------------------------------------------
Time: 1460572070000 ms
-------------------------------------------
Batch completed with 0 records
Batch started with 0 records
-------------------------------------------
Time: 1460572075000 ms
-------------------------------------------
Batch completed with 0 records
Batch started with 487 records
-------------------------------------------
Time: 1460572080000 ms
-------------------------------------------
(#TDS,(1,List(agreeableness_big5, analytical, anger, confident, conscientiousness_big5, disgust, extraversion_big5, fear, joy, neuroticism_big5, openness_big5, sadness, tentative),List(30.5, 0.0, 16.5, 0.0, 19.5, 3.0, 38.5, 20.0, 5.0, 32.0, 28.0, 9.0, 0.0)))
(#DolceAmoreILoveYou,(1,List(agreeableness_big5, analytical, anger, confident, conscientiousness_big5, disgust, extraversion_big5, fear, joy, neuroticism_big5, openness_big5, sadness, tentative),List(5.0, 0.0, 6.0, 0.0, 17.0, 1.0, 17.5, 12.5, 24.5, 34.0, 44.0, 2.0, 0.0)))
(#nasty,(1,List(agreeableness_big5, analytical, anger, confident, conscientiousness_big5, disgust, extraversion_big5, fear, joy, neuroticism_big5, openness_big5, sadness, tentative),List(0.5, 0.0, 16.0, 0.0, 0.5, 34.5, 49.0, 1.0, 0.0, 46.0, 16.0, 2.5, 0.0)))
(#Job:,(1,List(agreeableness_big5, analytical, anger, confident, conscientiousness_big5, disgust, extraversion_big5, fear, joy, neuroticism_big5, openness_big5, sadness, tentative),List(8.0, 0.0, 2.5, 0.0, 28.0, 1.5, 4.5, 2.5, 45.0, 19.5, 37.0, 3.5, 0.0)))
(#bigbrand,(1,List(agreeableness_big5, analytical, anger, confident, conscientiousness_big5, disgust, extraversion_big5, fear, joy, neuroticism_big5, openness_big5, sadness, tentative),List(5.5, 0.0, 6.0, 0.0, 49.0, 4.0, 2.0, 15.0, 12.5, 3.5, 48.5, 5.5, 0.0)))
(#SwitchUp,(1,List(agreeableness_big5, analytical, anger, confident, conscientiousness_big5, disgust, extraversion_big5, fear, joy, neuroticism_big5, openness_big5, sadness, tentative),List(47.5, 0.0, 3.5, 0.0, 34.5, 1.0, 47.0, 29.0, 11.5, 22.5, 1.0, 3.5, 0.0)))
(#Hiring,(1,List(agreeableness_big5, analytical, anger, confident, conscientiousness_big5, disgust, extraversion_big5, fear, joy, neuroticism_big5, openness_big5, sadness, tentative),List(8.0, 0.0, 2.5, 0.0, 28.0, 1.5, 4.5, 2.5, 45.0, 19.5, 37.0, 3.5, 0.0)))
(#entrepreneurship,(1,List(agreeableness_big5, analytical, anger, confident, conscientiousness_big5, disgust, extraversion_big5, fear, joy, neuroticism_big5, openness_big5, sadness, tentative),List(20.5, 25.5, 5.0, 0.0, 28.0, 9.0, 12.0, 3.0, 28.0, 4.0, 12.5, 2.5, 0.0)))
(#startup,(1,List(agreeableness_big5, analytical, anger, confident, conscientiousness_big5, disgust, extraversion_big5, fear, joy, neuroticism_big5, openness_big5, sadness, tentative),List(5.5, 0.0, 6.0, 0.0, 49.0, 4.0, 2.0, 15.0, 12.5, 3.5, 48.5, 5.5, 0.0)))
(#porn,(1,List(agreeableness_big5, analytical, anger, confident, conscientiousness_big5, disgust, extraversion_big5, fear, joy, neuroticism_big5, openness_big5, sadness, tentative),List(0.5, 0.0, 16.0, 0.0, 0.5, 34.5, 49.0, 1.0, 0.0, 46.0, 16.0, 2.5, 0.0)))
...
它看起来不像教程显示的那样: https://i0.wp.com/developer.ibm.com/clouddataservices/wp-content/uploads/sites/47/2016/01/Running-Spark-Streaming.png?缩放=2&w=980
我希望你能帮助我。是什么导致我的图表每隔几秒就改变一次?
当我关闭应用程序和内核并尝试重新打开它们时,这就是我所做的:
1-重新启动内核 2-再次运行所有单元
这是正确的吗 ?
谢谢@DavidTaieb