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

    https://github.com/apache/spark/pull/2808#discussion_r18999350
  
    --- Diff: docs/streaming-programming-guide.md ---
    @@ -398,6 +498,30 @@ JavaSparkContext sc = ...   //existing JavaSparkContext
     JavaStreamingContext ssc = new JavaStreamingContext(sc, new 
Duration(1000));
     {% endhighlight %} 
     </div>
    +<div data-lang="python" markdown="1">
    +
    +A 
[StreamingContext](api/python/pyspark.streaming.html#pyspark.streaming.StreamingContext)
 object can be created from a 
[SparkContext](api/python/pyspark.html#pyspark.SparkContext) object.
    +
    +{% highlight python %}
    +from pyspark import SparkContext
    +from pyspark.streaming import StreamingContext
    +
    +sc = SparkContext(master, appName)
    +ssc = StreamingContext(sc, 1)
    +{% endhighlight %}
    +
    +The `appName` parameter is a name for your application to show on the 
cluster UI.
    +`master` is a [Spark, Mesos or YARN cluster 
URL](submitting-applications.html#master-urls),
    +or a special __"local[\*]"__ string to run in local mode. In practice, 
when running on a cluster, 
    +you will not want to hardcode `master` in the program,
    +but rather [launch the application with 
`spark-submit`](submitting-applications.html) and
    +receive it there. However, for local testing and unit tests, you can pass 
"local[\*]" to run Spark Streaming
    +in-process (detects the number of cores in the local system).
    +
    +The batch interval must be set based on the latency requirements of your 
application
    +and available cluster resources. See the [Performance 
Tuning](#setting-the-right-batch-size)
    +section for more details.
    +</div>
     </div>
     
     After a context is defined, you have to do the follow steps.
    --- End diff --
    
    As long as you're editing this file, it would be nice to fix the incorrect 
formatting of the list here; the current markdown renders as 
    
    
![image](https://cloud.githubusercontent.com/assets/50748/4673751/260a0d02-55a8-11e4-8ad1-6313cab2d4cc.png)



---
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