spark-instrumented-optimizer/docs
Patrick Wendell 08c1a42d7d Add a repartition operator.
This patch adds an operator called repartition with more straightforward
semantics than the current `coalesce` operator. There are a few use cases
where this operator is useful:

1. If a user wants to increase the number of partitions in the RDD. This
is more common now with streaming. E.g. a user is ingesting data on one
node but they want to add more partitions to ensure parallelism of
subsequent operations across threads or the cluster.

Right now they have to call rdd.coalesce(numSplits, shuffle=true) - that's
super confusing.

2. If a user has input data where the number of partitions is not known. E.g.

> sc.textFile("some file").coalesce(50)....

This is both vague semantically (am I growing or shrinking this RDD) but also,
may not work correctly if the base RDD has fewer than 50 partitions.

The new operator forces shuffles every time, so it will always produce exactly
the number of new partitions. It also throws an exception rather than silently
not-working if a bad input is passed.

I am currently adding streaming tests (requires refactoring some of the test
suite to allow testing at partition granularity), so this is not ready for
merge yet. But feedback is welcome.
2013-10-24 14:31:33 -07:00
..
_layouts Merging build changes in from 0.8 2013-10-05 22:07:00 -07:00
_plugins Update jekyll plugin to match docs/README.md 2013-08-21 12:57:56 -07:00
css Some doc improvements 2013-09-02 13:35:28 -07:00
img Updated cluster diagram to show caches 2013-09-08 13:51:57 -07:00
js Adding docs directory containing documentation currently on the wiki 2012-09-12 13:03:43 -07:00
_config.yml Update build version in master 2013-09-24 11:41:51 -07:00
api.md Merge branch 'master' into streaming 2013-01-15 12:08:51 -08:00
bagel-programming-guide.md Some doc improvements 2013-09-02 13:35:28 -07:00
building-with-maven.md Fix typo in Maven build docs 2013-09-15 13:29:22 -07:00
cluster-overview.md Change port from 3030 to 4040 2013-09-11 10:01:38 -07:00
configuration.md Merge pull request #76 from pwendell/master 2013-10-18 23:19:42 -07:00
contributing-to-spark.md Work in progress: 2013-09-08 00:29:11 -07:00
ec2-scripts.md More fair scheduler docs and property names. 2013-09-08 00:29:11 -07:00
hadoop-third-party-distributions.md Some tweaks to CDH/HDP doc 2013-09-08 00:44:41 -07:00
hardware-provisioning.md Change port from 3030 to 4040 2013-09-11 10:01:38 -07:00
index.md Added cluster overview doc, made logo higher-resolution, and added more 2013-09-08 00:29:11 -07:00
java-programming-guide.md Fix more URLs in docs 2013-09-01 14:13:16 -07:00
job-scheduling.md Review comments 2013-09-08 13:36:50 -07:00
mllib-guide.md Adding implicit feedback ALS to MLlib user guide 2013-10-04 14:39:44 +02:00
monitoring.md Change port from 3030 to 4040 2013-09-11 10:01:38 -07:00
python-programming-guide.md Add notes to python documentation about using SparkContext.setSystemProperty. 2013-10-22 11:49:52 -07:00
quick-start.md Fix some review comments 2013-09-08 21:25:49 -07:00
README.md Fix some URLs 2013-09-01 14:13:16 -07:00
running-on-mesos.md More updates to Spark on Mesos documentation. 2013-09-11 16:08:54 -07:00
running-on-yarn.md Merge remote-tracking branch 'tgravescs/sparkYarnDistCache' 2013-10-10 19:34:33 -07:00
scala-programming-guide.md Docs: Fix links to RDD API documentation 2013-10-22 09:39:36 -07:00
spark-debugger.md Fix more URLs in docs 2013-09-01 14:13:16 -07:00
spark-standalone.md Minor clarification and cleanup to spark-standalone.md 2013-10-10 14:45:12 -07:00
streaming-custom-receivers.md More fixes 2013-09-01 14:13:16 -07:00
streaming-programming-guide.md Add a repartition operator. 2013-10-24 14:31:33 -07:00
tuning.md Add docs for standalone scheduler fault tolerance 2013-10-08 14:18:31 -07:00

Welcome to the Spark documentation!

This readme will walk you through navigating and building the Spark documentation, which is included here with the Spark source code. You can also find documentation specific to release versions of Spark at http://spark.incubator.apache.org/documentation.html.

Read on to learn more about viewing documentation in plain text (i.e., markdown) or building the documentation yourself. Why build it yourself? So that you have the docs that corresponds to whichever version of Spark you currently have checked out of revision control.

Generating the Documentation HTML

We include the Spark documentation as part of the source (as opposed to using a hosted wiki, such as the github wiki, as the definitive documentation) to enable the documentation to evolve along with the source code and be captured by revision control (currently git). This way the code automatically includes the version of the documentation that is relevant regardless of which version or release you have checked out or downloaded.

In this directory you will find textfiles formatted using Markdown, with an ".md" suffix. You can read those text files directly if you want. Start with index.md.

To make things quite a bit prettier and make the links easier to follow, generate the html version of the documentation based on the src directory by running jekyll in the docs directory. Use the command SKIP_SCALADOC=1 jekyll to skip building and copying over the scaladoc which can be timely. To use the jekyll command, you will need to have Jekyll installed, the easiest way to do this is via a Ruby Gem, see the jekyll installation instructions. This will create a directory called _site containing index.html as well as the rest of the compiled files. Read more about Jekyll at https://github.com/mojombo/jekyll/wiki.

In addition to generating the site as html from the markdown files, jekyll can serve up the site via a webserver. To build and run a webserver use the command jekyll --server which (currently) runs the webserver on port 4000, then visit the site at http://localhost:4000.

Pygments

We also use pygments (http://pygments.org) for syntax highlighting in documentation markdown pages, so you will also need to install that (it requires Python) by running sudo easy_install Pygments.

To mark a block of code in your markdown to be syntax highlighted by jekyll during the compile phase, use the following sytax:

{% highlight scala %}
// Your scala code goes here, you can replace scala with many other
// supported languages too.
{% endhighlight %}

API Docs (Scaladoc and Epydoc)

You can build just the Spark scaladoc by running sbt/sbt doc from the SPARK_PROJECT_ROOT directory.

Similarly, you can build just the PySpark epydoc by running epydoc --config epydoc.conf from the SPARK_PROJECT_ROOT/pyspark directory.

When you run jekyll in the docs directory, it will also copy over the scaladoc for the various Spark subprojects into the docs directory (and then also into the _site directory). We use a jekyll plugin to run sbt/sbt doc before building the site so if you haven't run it (recently) it may take some time as it generates all of the scaladoc. The jekyll plugin also generates the PySpark docs using epydoc.

NOTE: To skip the step of building and copying over the Scala and Python API docs, run SKIP_API=1 jekyll.