forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request apache#497 from tdas/docs-update
Updated Spark Streaming Programming Guide Here is the updated version of the Spark Streaming Programming Guide. This is still a work in progress, but the major changes are in place. So feedback is most welcome. In general, I have tried to make the guide to easier to understand even if the reader does not know much about Spark. The updated website is hosted here - http://www.eecs.berkeley.edu/~tdas/spark_docs/streaming-programming-guide.html The major changes are: - Overview illustrates the usecases of Spark Streaming - various input sources and various output sources - An example right after overview to quickly give an idea of what Spark Streaming program looks like - Made Java API and examples a first class citizen like Scala by using tabs to show both Scala and Java examples (similar to AMPCamp tutorial's code tabs) - Highlighted the DStream operations updateStateByKey and transform because of their powerful nature - Updated driver node failure recovery text to highlight automatic recovery in Spark standalone mode - Added information about linking and using the external input sources like Kafka and Flume - In general, reorganized the sections to better show the Basic section and the more advanced sections like Tuning and Recovery. Todos: - Links to the docs of external Kafka, Flume, etc - Illustrate window operation with figure as well as example. Author: Tathagata Das <[email protected]> == Merge branch commits == commit 18ff10556570b39d672beeb0a32075215cfcc944 Author: Tathagata Das <[email protected]> Date: Tue Jan 28 21:49:30 2014 -0800 Fixed a lot of broken links. commit 34a5a6008dac2e107624c7ff0db0824ee5bae45f Author: Tathagata Das <[email protected]> Date: Tue Jan 28 18:02:28 2014 -0800 Updated github url to use SPARK_GITHUB_URL variable. commit f338a60ae8069e0a382d2cb170227e5757cc0b7a Author: Tathagata Das <[email protected]> Date: Mon Jan 27 22:42:42 2014 -0800 More updates based on Patrick and Harvey's comments. commit 89a81ff25726bf6d26163e0dd938290a79582c0f Author: Tathagata Das <[email protected]> Date: Mon Jan 27 13:08:34 2014 -0800 Updated docs based on Patricks PR comments. commit d5b6196b532b5746e019b959a79ea0cc013a8fc3 Author: Tathagata Das <[email protected]> Date: Sun Jan 26 20:15:58 2014 -0800 Added spark.streaming.unpersist config and info on StreamingListener interface. commit e3dcb46ab83d7071f611d9b5008ba6bc16c9f951 Author: Tathagata Das <[email protected]> Date: Sun Jan 26 18:41:12 2014 -0800 Fixed docs on StreamingContext.getOrCreate. commit 6c29524639463f11eec721e4d17a9d7159f2944b Author: Tathagata Das <[email protected]> Date: Thu Jan 23 18:49:39 2014 -0800 Added example and figure for window operations, and links to Kafka and Flume API docs. commit f06b964a51bb3b21cde2ff8bdea7d9785f6ce3a9 Author: Tathagata Das <[email protected]> Date: Wed Jan 22 22:49:12 2014 -0800 Fixed missing endhighlight tag in the MLlib guide. commit 036a7d46187ea3f2a0fb8349ef78f10d6c0b43a9 Merge: eab351d a1cd185 Author: Tathagata Das <[email protected]> Date: Wed Jan 22 22:17:42 2014 -0800 Merge remote-tracking branch 'apache/master' into docs-update commit eab351d05c0baef1d4b549e1581310087158d78d Author: Tathagata Das <[email protected]> Date: Wed Jan 22 22:17:15 2014 -0800 Update Spark Streaming Programming Guide. (cherry picked from commit 7930209) Conflicts: docs/mllib-guide.md
- Loading branch information
Showing
18 changed files
with
1,162 additions
and
300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,107 @@ | ||
|
||
// From docs.scala-lang.org | ||
function styleCode() { | ||
if (typeof disableStyleCode != "undefined") { | ||
return; | ||
} | ||
$(".codetabs pre code").parent().each(function() { | ||
if (!$(this).hasClass("prettyprint")) { | ||
var lang = $(this).parent().data("lang"); | ||
if (lang == "python") { | ||
lang = "py" | ||
} | ||
if (lang == "bash") { | ||
lang = "bsh" | ||
} | ||
$(this).addClass("prettyprint lang-"+lang+" linenums"); | ||
} | ||
}); | ||
console.log("runningPrettyPrint()") | ||
prettyPrint(); | ||
} | ||
|
||
|
||
function codeTabs() { | ||
var counter = 0; | ||
var langImages = { | ||
"scala": "img/scala-sm.png", | ||
"python": "img/python-sm.png", | ||
"java": "img/java-sm.png" | ||
}; | ||
$("div.codetabs").each(function() { | ||
$(this).addClass("tab-content"); | ||
|
||
// Insert the tab bar | ||
var tabBar = $('<ul class="nav nav-tabs" data-tabs="tabs"></ul>'); | ||
$(this).before(tabBar); | ||
|
||
// Add each code sample to the tab bar: | ||
var codeSamples = $(this).children("div"); | ||
codeSamples.each(function() { | ||
$(this).addClass("tab-pane"); | ||
var lang = $(this).data("lang"); | ||
var image = $(this).data("image"); | ||
var notabs = $(this).data("notabs"); | ||
var capitalizedLang = lang.substr(0, 1).toUpperCase() + lang.substr(1); | ||
var id = "tab_" + lang + "_" + counter; | ||
$(this).attr("id", id); | ||
if (image != null && langImages[lang]) { | ||
var buttonLabel = "<img src='" +langImages[lang] + "' alt='" + capitalizedLang + "' />"; | ||
} else if (notabs == null) { | ||
var buttonLabel = "<b>" + capitalizedLang + "</b>"; | ||
} else { | ||
var buttonLabel = "" | ||
} | ||
tabBar.append( | ||
'<li><a class="tab_' + lang + '" href="#' + id + '">' + buttonLabel + '</a></li>' | ||
); | ||
}); | ||
|
||
codeSamples.first().addClass("active"); | ||
tabBar.children("li").first().addClass("active"); | ||
counter++; | ||
}); | ||
$("ul.nav-tabs a").click(function (e) { | ||
// Toggling a tab should switch all tabs corresponding to the same language | ||
// while retaining the scroll position | ||
e.preventDefault(); | ||
var scrollOffset = $(this).offset().top - $(document).scrollTop(); | ||
$("." + $(this).attr('class')).tab('show'); | ||
$(document).scrollTop($(this).offset().top - scrollOffset); | ||
}); | ||
} | ||
|
||
function makeCollapsable(elt, accordionClass, accordionBodyId, title) { | ||
$(elt).addClass("accordion-inner"); | ||
$(elt).wrap('<div class="accordion ' + accordionClass + '"></div>') | ||
$(elt).wrap('<div class="accordion-group"></div>') | ||
$(elt).wrap('<div id="' + accordionBodyId + '" class="accordion-body collapse"></div>') | ||
$(elt).parent().before( | ||
'<div class="accordion-heading">' + | ||
'<a class="accordion-toggle" data-toggle="collapse" href="#' + accordionBodyId + '">' + | ||
title + | ||
'</a>' + | ||
'</div>' | ||
); | ||
} | ||
|
||
function viewSolution() { | ||
var counter = 0 | ||
$("div.solution").each(function() { | ||
var id = "solution_" + counter | ||
makeCollapsable(this, "", id, | ||
'<i class="icon-ok-sign" style="text-decoration: none; color: #0088cc">' + | ||
'</i>' + "View Solution"); | ||
counter++; | ||
}); | ||
} | ||
|
||
|
||
$(document).ready(function() { | ||
codeTabs(); | ||
viewSolution(); | ||
$('#chapter-toc').toc({exclude: '', context: '.container'}); | ||
$('#chapter-toc').prepend('<p class="chapter-toc-header">In This Chapter</p>'); | ||
makeCollapsable($('#global-toc'), "", "global-toc", "Show Table of Contents"); | ||
//styleCode(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.