Added: incubator/zeppelin/site/docs/0.5.0-incubating/rest-api/rest-interpreter.html URL: http://svn.apache.org/viewvc/incubator/zeppelin/site/docs/0.5.0-incubating/rest-api/rest-interpreter.html?rev=1715104&view=auto ============================================================================== --- incubator/zeppelin/site/docs/0.5.0-incubating/rest-api/rest-interpreter.html (added) +++ incubator/zeppelin/site/docs/0.5.0-incubating/rest-api/rest-interpreter.html Thu Nov 19 06:38:15 2015 @@ -0,0 +1,717 @@ + +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Interpreter REST API</title> + <meta name="description" content=""> + <meta name="author" content="The Apache Software Foundation"> + + <!-- Enable responsive viewport --> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <!-- Le HTML5 shim, for IE6-8 support of HTML elements --> + <!--[if lt IE 9]> + <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> + <![endif]--> + + <!-- Le styles --> + <link href="/assets/themes/zeppelin/bootstrap/css/bootstrap.css" rel="stylesheet"> + <link href="/assets/themes/zeppelin/css/style.css?body=1" rel="stylesheet" type="text/css"> + <link href="/assets/themes/zeppelin/css/syntax.css" rel="stylesheet" type="text/css" media="screen" /> + <!-- Le fav and touch icons --> + <!-- Update these with your own images + <link rel="shortcut icon" href="images/favicon.ico"> + <link rel="apple-touch-icon" href="images/apple-touch-icon.png"> + <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png"> + <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png"> + --> + + <!-- Js --> + <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script> + <script src="/assets/themes/zeppelin/bootstrap/js/bootstrap.min.js"></script> + + <!-- atom & rss feed --> + <link href="/atom.xml" type="application/atom+xml" rel="alternate" title="Sitewide ATOM Feed"> + <link href="/rss.xml" type="application/rss+xml" rel="alternate" title="Sitewide RSS Feed"> + </head> + + <body> + + <div class="navbar navbar-inverse navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="/"> + <img src="/assets/themes/zeppelin/img/zeppelin_logo.png" width="50" alt="I'm zeppelin"> + Zeppelin <small>(0.5.0-incubating)</small> + </a> + </div> + <nav class="navbar-collapse collapse" role="navigation"> + <ul class="nav navbar-nav"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + </ul> + <ul class="nav navbar-nav navbar-right"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs.html">Docs</a></li> + + + + + + + + <li><a href="/index.html">Overview</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + </ul> + </nav><!--/.navbar-collapse --> + </div> + </div> + + + <div class="container"> + +<!--<div class="hero-unit Interpreter REST API"> + <h1></h1> +</div> +--> + +<div class="row"> + <div class="col-md-12"> + <!-- +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +<h2>Zeppelin REST API</h2> + +<p>Zeppelin provides several REST API's for interaction and remote activation of zeppelin functionality.</p> + +<p>All REST API are available starting with the following endpoint <code>http://[zeppelin-server]:[zeppelin-port]/api</code></p> + +<p>Note that zeppein REST API receive or return JSON objects, it it recommended you install some JSON view such as + <a href="https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc">JSONView</a></p> + +<p>If you work with zeppelin and find a need for an additional REST API please <a href="../../community.html">file an issue or send us mail</a> </p> + +<p><br /></p> + +<h3>Interpreter REST API list</h3> + +<p>The role of registered interpreters, settings and interpreters group is described <a href="../manual/interpreters.html">here</a></p> + +<p><table class="table-configuration"> + <col width="200"> + <tr> + <th>List registered interpreters</th> + <th></th> + </tr> + <tr> + <td>Description</td> + <td>This <code>GET</code> method return all the registered interpreters available on the server.</td> + </tr> + <tr> + <td>URL</td> + <td><code>http://[zeppelin-server]:[zeppelin-port]/api/interpreter</code></td> + </tr> + <tr> + <td>Success code</td> + <td>200</td> + </tr> + <tr> + <td> Fail code</td> + <td> 500 </td> + </tr> + <tr> + <td> sample JSON response + </td> + <td> + <pre> +{ + "status": "OK", + "message": "", + "body": { + "md.md": { + "name": "md", + "group": "md", + "className": "org.apache.zeppelin.markdown.Markdown", + "properties": {}, + "path": "/zeppelin/interpreter/md" + }, + "spark.spark": { + "name": "spark", + "group": "spark", + "className": "org.apache.zeppelin.spark.SparkInterpreter", + "properties": { + "spark.executor.memory": { + "defaultValue": "512m", + "description": "Executor memory per worker instance. ex) 512m, 32g" + }, + "spark.cores.max": { + "defaultValue": "", + "description": "Total number of cores to use. Empty value uses all available core." + }, + }, + "path": "/zeppelin/interpreter/spark" + }, + "spark.sql": { + "name": "sql", + "group": "spark", + "className": "org.apache.zeppelin.spark.SparkSqlInterpreter", + "properties": { + "zeppelin.spark.maxResult": { + "defaultValue": "1000", + "description": "Max number of SparkSQL result to display." + } + }, + "path": "/zeppelin/interpreter/spark" + } + } +} + </pre> + </td> + </tr> + </table></p> + +<p><br/></p> + +<p><table class="table-configuration"> + <col width="200"> + <tr> + <th>List interpreters settings</th> + <th></th> + </tr> + <tr> + <td>Description</td> + <td>This <code>GET</code> method return all the interpreters settings registered on the server.</td> + </tr> + <tr> + <td>URL</td> + <td><code>http://[zeppelin-server]:[zeppelin-port]/api/interpreter/setting</code></td> + </tr> + <tr> + <td>Success code</td> + <td>200</td> + </tr> + <tr> + <td> Fail code</td> + <td> 500 </td> + </tr> + <tr> + <td> sample JSON response + </td> + <td> + <pre> +{ + "status": "OK", + "message": "", + "body": [ + { + "id": "2AYUGP2D5", + "name": "md", + "group": "md", + "properties": { + "<em>empty</em>": "" + }, + "interpreterGroup": [ + { + "class": "org.apache.zeppelin.markdown.Markdown", + "name": "md" + } + ] + },<br> + { + "id": "2AY6GV7Q3", + "name": "spark", + "group": "spark", + "properties": { + "spark.cores.max": "", + "spark.executor.memory": "512m", + }, + "interpreterGroup": [ + { + "class": "org.apache.zeppelin.spark.SparkInterpreter", + "name": "spark" + }, + { + "class": "org.apache.zeppelin.spark.SparkSqlInterpreter", + "name": "sql" + } + ] + } + ] +} + </pre> + </td> + </tr> + </table></p> + +<p><br/></p> + +<p><table class="table-configuration"> + <col width="200"> + <tr> + <th>Create an interpreter setting</th> + <th></th> + </tr> + <tr> + <td>Description</td> + <td>This <code>POST</code> method adds a new interpreter setting using a registered interpreter to the server.</td> + </tr> + <tr> + <td>URL</td> + <td><code>http://[zeppelin-server]:[zeppelin-port]/api/interpreter/setting</code></td> + </tr> + <tr> + <td>Success code</td> + <td>201</td> + </tr> + <tr> + <td> Fail code</td> + <td> 500 </td> + </tr> + <tr> + <td> sample JSON input + </td> + <td> + <pre> +{ + "name": "Markdown setting name", + "group": "md", + "properties": { + "propname": "propvalue" + }, + "interpreterGroup": [ + { + "class": "org.apache.zeppelin.markdown.Markdown", + "name": "md" + } + ] +} + </pre> + </td> + </tr> + <tr> + <td> sample JSON response + </td> + <td> + <pre> +{ + "status": "CREATED", + "message": "", + "body": { + "id": "2AYW25ANY", + "name": "Markdown setting name", + "group": "md", + "properties": { + "propname": "propvalue" + }, + "interpreterGroup": [ + { + "class": "org.apache.zeppelin.markdown.Markdown", + "name": "md" + } + ] + } +} + </pre> + </td> + </tr> + </table></p> + +<p><br/></p> + +<p><table class="table-configuration"> + <col width="200"> + <tr> + <th>Update an interpreter setting</th> + <th></th> + </tr> + <tr> + <td>Description</td> + <td>This <code>PUT</code> method updates an interpreter setting with new properties.</td> + </tr> + <tr> + <td>URL</td> + <td><code>http://[zeppelin-server]:[zeppelin-port]/api/interpreter/setting/[interpreter ID]</code></td> + </tr> + <tr> + <td>Success code</td> + <td>200</td> + </tr> + <tr> + <td> Fail code</td> + <td> 500 </td> + </tr> + <tr> + <td> sample JSON input + </td> + <td> + <pre> +{ + "name": "Markdown setting name", + "group": "md", + "properties": { + "propname": "Otherpropvalue" + }, + "interpreterGroup": [ + { + "class": "org.apache.zeppelin.markdown.Markdown", + "name": "md" + } + ] +} + </pre> + </td> + </tr> + <tr> + <td> sample JSON response + </td> + <td> + <pre> +{ + "status": "OK", + "message": "", + "body": { + "id": "2AYW25ANY", + "name": "Markdown setting name", + "group": "md", + "properties": { + "propname": "Otherpropvalue" + }, + "interpreterGroup": [ + { + "class": "org.apache.zeppelin.markdown.Markdown", + "name": "md" + } + ] + } +} + </pre> + </td> + </tr> + </table></p> + +<p><br/></p> + +<p><table class="table-configuration"> + <col width="200"> + <tr> + <th>Delete an interpreter setting</th> + <th></th> + </tr> + <tr> + <td>Description</td> + <td>This <code>DELETE</code> method deletes an given interpreter setting.</td> + </tr> + <tr> + <td>URL</td> + <td><code>http://[zeppelin-server]:[zeppelin-port]/api/interpreter/setting/[interpreter ID]</code></td> + </tr> + <tr> + <td>Success code</td> + <td>200</td> + </tr> + <tr> + <td> Fail code</td> + <td> 500 </td> + </tr> + <tr> + <td> sample JSON response + </td> + <td> + <pre>{"status":"OK"}</pre> + </td> + </tr> + </table></p> + + </div> +</div> + + + <hr> + <footer> + <!-- <p>© 2015 The Apache Software Foundation</p>--> + </footer> + </div> + + + + + <script type="text/javascript"> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-45176241-5', 'zeppelin.incubator.apache.org'); + ga('require', 'linkid', 'linkid.js'); + ga('send', 'pageview'); + +</script> + + + + </body> +</html> +
Added: incubator/zeppelin/site/docs/0.5.0-incubating/rest-api/rest-notebook.html URL: http://svn.apache.org/viewvc/incubator/zeppelin/site/docs/0.5.0-incubating/rest-api/rest-notebook.html?rev=1715104&view=auto ============================================================================== --- incubator/zeppelin/site/docs/0.5.0-incubating/rest-api/rest-notebook.html (added) +++ incubator/zeppelin/site/docs/0.5.0-incubating/rest-api/rest-notebook.html Thu Nov 19 06:38:15 2015 @@ -0,0 +1,526 @@ + +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Notebook REST API</title> + <meta name="description" content=""> + <meta name="author" content="The Apache Software Foundation"> + + <!-- Enable responsive viewport --> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <!-- Le HTML5 shim, for IE6-8 support of HTML elements --> + <!--[if lt IE 9]> + <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> + <![endif]--> + + <!-- Le styles --> + <link href="/assets/themes/zeppelin/bootstrap/css/bootstrap.css" rel="stylesheet"> + <link href="/assets/themes/zeppelin/css/style.css?body=1" rel="stylesheet" type="text/css"> + <link href="/assets/themes/zeppelin/css/syntax.css" rel="stylesheet" type="text/css" media="screen" /> + <!-- Le fav and touch icons --> + <!-- Update these with your own images + <link rel="shortcut icon" href="images/favicon.ico"> + <link rel="apple-touch-icon" href="images/apple-touch-icon.png"> + <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png"> + <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png"> + --> + + <!-- Js --> + <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script> + <script src="/assets/themes/zeppelin/bootstrap/js/bootstrap.min.js"></script> + + <!-- atom & rss feed --> + <link href="/atom.xml" type="application/atom+xml" rel="alternate" title="Sitewide ATOM Feed"> + <link href="/rss.xml" type="application/rss+xml" rel="alternate" title="Sitewide RSS Feed"> + </head> + + <body> + + <div class="navbar navbar-inverse navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="/"> + <img src="/assets/themes/zeppelin/img/zeppelin_logo.png" width="50" alt="I'm zeppelin"> + Zeppelin <small>(0.5.0-incubating)</small> + </a> + </div> + <nav class="navbar-collapse collapse" role="navigation"> + <ul class="nav navbar-nav"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + </ul> + <ul class="nav navbar-nav navbar-right"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs.html">Docs</a></li> + + + + + + + + <li><a href="/index.html">Overview</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + </ul> + </nav><!--/.navbar-collapse --> + </div> + </div> + + + <div class="container"> + +<!--<div class="hero-unit Notebook REST API"> + <h1></h1> +</div> +--> + +<div class="row"> + <div class="col-md-12"> + <!-- +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +<h2>Zeppelin REST API</h2> + +<p>Zeppelin provides several REST API's for interaction and remote activation of zeppelin functionality.</p> + +<p>All REST API are available starting with the following endpoint <code>http://[zeppelin-server]:[zeppelin-port]/api</code></p> + +<p>Note that zeppein REST API receive or return JSON objects, it it recommended you install some JSON view such as + <a href="https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc">JSONView</a></p> + +<p>If you work with zeppelin and find a need for an additional REST API please <a href="../../community.html">file an issue or send us mail</a> </p> + +<p><br /></p> + +<h3>Notebook REST API list</h3> + +<p>Notebooks REST API supports the following operations: List, Create, Delete & Clone as detailed in the following table </p> + +<p><table class="table-configuration"> + <col width="200"> + <tr> + <th>List notebooks</th> + <th></th> + </tr> + <tr> + <td>Description</td> + <td>This <code>GET</code> method list the available notebooks on your server. + Notebook JSON contains the <code>name</code> and <code>id</code> of all notebooks. + </td> + </tr> + <tr> + <td>URL</td> + <td><code>http://[zeppelin-server]:[zeppelin-port]/api/notebook</code></td> + </tr> + <tr> + <td>Success code</td> + <td>200</td> + </tr> + <tr> + <td> Fail code</td> + <td> 500 </td> + </tr> + <tr> + <td> sample JSON response </td> + <td><pre>{"status":"OK","message":"","body":[{"name":"Homepage","id":"2AV4WUEMK"},{"name":"Zeppelin Tutorial","id":"2A94M5J1Z"}]}</pre></td> + </tr> + </table></p> + +<p><br/></p> + +<p><table class="table-configuration"> + <col width="200"> + <tr> + <th>Create notebook</th> + <th></th> + </tr> + <tr> + <td>Description</td> + <td>This <code>POST</code> method create a new notebook using the given name or default name if none given. + The body field of the returned JSON contain the new notebook id. + </td> + </tr> + <tr> + <td>URL</td> + <td><code>http://[zeppelin-server]:[zeppelin-port]/api/notebook</code></td> + </tr> + <tr> + <td>Success code</td> + <td>201</td> + </tr> + <tr> + <td> Fail code</td> + <td> 500 </td> + </tr> + <tr> + <td> sample JSON input </td> + <td><pre>{"name": "name of new notebook"}</pre></td> + </tr> + <tr> + <td> sample JSON response </td> + <td><pre>{"status": "CREATED","message": "","body": "2AZPHY918"}</pre></td> + </tr> + </table></p> + +<p><br/></p> + +<p><table class="table-configuration"> + <col width="200"> + <tr> + <th>Delete notebook</th> + <th></th> + </tr> + <tr> + <td>Description</td> + <td>This <code>DELETE</code> method delete a notebook by the given notebook id. + </td> + </tr> + <tr> + <td>URL</td> + <td><code>http://[zeppelin-server]:[zeppelin-port]/api/notebook/[notebookId]</code></td> + </tr> + <tr> + <td>Success code</td> + <td>200</td> + </tr> + <tr> + <td> Fail code</td> + <td> 500 </td> + </tr> + <tr> + <td> sample JSON response </td> + <td><pre>{"status":"OK","message":""}</pre></td> + </tr> + </table></p> + +<p><br/></p> + +<p><table class="table-configuration"> + <col width="200"> + <tr> + <th>Clone notebook</th> + <th></th> + </tr> + <tr> + <td>Description</td> + <td>This <code>POST</code> method clone a notebook by the given id and create a new notebook using the given name + or default name if none given. + The body field of the returned JSON contain the new notebook id. + </td> + </tr> + <tr> + <td>URL</td> + <td><code>http://[zeppelin-server]:[zeppelin-port]/api/notebook/[notebookId]</code></td> + </tr> + <tr> + <td>Success code</td> + <td>201</td> + </tr> + <tr> + <td> Fail code</td> + <td> 500 </td> + </tr> + <tr> + <td> sample JSON input </td> + <td><pre>{"name": "name of new notebook"}</pre></td> + </tr> + <tr> + <td> sample JSON response </td> + <td><pre>{"status": "CREATED","message": "","body": "2AZPHY918"}</pre></td> + </tr> + </table></p> + + </div> +</div> + + + <hr> + <footer> + <!-- <p>© 2015 The Apache Software Foundation</p>--> + </footer> + </div> + + + + + <script type="text/javascript"> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-45176241-5', 'zeppelin.incubator.apache.org'); + ga('require', 'linkid', 'linkid.js'); + ga('send', 'pageview'); + +</script> + + + + </body> +</html> + Added: incubator/zeppelin/site/docs/0.5.0-incubating/robot.txt URL: http://svn.apache.org/viewvc/incubator/zeppelin/site/docs/0.5.0-incubating/robot.txt?rev=1715104&view=auto ============================================================================== --- incubator/zeppelin/site/docs/0.5.0-incubating/robot.txt (added) +++ incubator/zeppelin/site/docs/0.5.0-incubating/robot.txt Thu Nov 19 06:38:15 2015 @@ -0,0 +1,14 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. Added: incubator/zeppelin/site/docs/0.5.0-incubating/rss.xml URL: http://svn.apache.org/viewvc/incubator/zeppelin/site/docs/0.5.0-incubating/rss.xml?rev=1715104&view=auto ============================================================================== --- incubator/zeppelin/site/docs/0.5.0-incubating/rss.xml (added) +++ incubator/zeppelin/site/docs/0.5.0-incubating/rss.xml Thu Nov 19 06:38:15 2015 @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<rss version="2.0"> +<channel> + <title>Apache Zeppelin (incubating)</title> + <description>Apache Zeppelin (incubating) - The Apache Software Foundation</description> + <link>http://zeppelin.incubator.apache.org</link> + <link>http://zeppelin.incubator.apache.org</link> + <lastBuildDate>2015-11-19T15:18:22+09:00</lastBuildDate> + <pubDate>2015-11-19T15:18:22+09:00</pubDate> + <ttl>1800</ttl> + + + +</channel> +</rss> Added: incubator/zeppelin/site/docs/0.5.0-incubating/screenshots.html URL: http://svn.apache.org/viewvc/incubator/zeppelin/site/docs/0.5.0-incubating/screenshots.html?rev=1715104&view=auto ============================================================================== --- incubator/zeppelin/site/docs/0.5.0-incubating/screenshots.html (added) +++ incubator/zeppelin/site/docs/0.5.0-incubating/screenshots.html Thu Nov 19 06:38:15 2015 @@ -0,0 +1,402 @@ + +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Screenshots</title> + <meta name="description" content=""> + <meta name="author" content="The Apache Software Foundation"> + + <!-- Enable responsive viewport --> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <!-- Le HTML5 shim, for IE6-8 support of HTML elements --> + <!--[if lt IE 9]> + <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> + <![endif]--> + + <!-- Le styles --> + <link href="/assets/themes/zeppelin/bootstrap/css/bootstrap.css" rel="stylesheet"> + <link href="/assets/themes/zeppelin/css/style.css?body=1" rel="stylesheet" type="text/css"> + <link href="/assets/themes/zeppelin/css/syntax.css" rel="stylesheet" type="text/css" media="screen" /> + <!-- Le fav and touch icons --> + <!-- Update these with your own images + <link rel="shortcut icon" href="images/favicon.ico"> + <link rel="apple-touch-icon" href="images/apple-touch-icon.png"> + <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png"> + <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png"> + --> + + <!-- Js --> + <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script> + <script src="/assets/themes/zeppelin/bootstrap/js/bootstrap.min.js"></script> + + <!-- atom & rss feed --> + <link href="/atom.xml" type="application/atom+xml" rel="alternate" title="Sitewide ATOM Feed"> + <link href="/rss.xml" type="application/rss+xml" rel="alternate" title="Sitewide RSS Feed"> + </head> + + <body> + + <div class="navbar navbar-inverse navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="/"> + <img src="/assets/themes/zeppelin/img/zeppelin_logo.png" width="50" alt="I'm zeppelin"> + Zeppelin <small>(0.5.0-incubating)</small> + </a> + </div> + <nav class="navbar-collapse collapse" role="navigation"> + <ul class="nav navbar-nav"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + </ul> + <ul class="nav navbar-nav navbar-right"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs.html">Docs</a></li> + + + + + + + + <li><a href="/index.html">Overview</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + </ul> + </nav><!--/.navbar-collapse --> + </div> + </div> + + + <div class="container"> + +<!--<div class="hero-unit Screenshots"> + <h1></h1> +</div> +--> + +<div class="row"> + <div class="col-md-12"> + <!-- +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +<div class="row"> + <div class="col-md-3"> + <a href="assets/themes/zeppelin/img/screenshots/sparksql.png"><img class="thumbnail" src="assets/themes/zeppelin/img/screenshots/sparksql.png" /></a> + <center>SparkSQL with inline visualization</center> + </div> + <div class="col-md-3"> + <a href="assets/themes/zeppelin/img/screenshots/spark.png"><img class="thumbnail" src="assets/themes/zeppelin/img/screenshots/spark.png" /></a> + <center>Scala code runs with Spark</center> + </div> + <div class="col-md-3"> + <a href="assets/themes/zeppelin/img/screenshots/markdown.png"><img class="thumbnail" src="assets/themes/zeppelin/img/screenshots/markdown.png" /></a> + <center>Markdown supported</center> + </div> +</div> + +<p><br /> +<div class="row"> + <div class="col-md-3"> + <a href="assets/themes/zeppelin/img/screenshots/notebook.png"><img class="thumbnail" src="assets/themes/zeppelin/img/screenshots/notebook.png" /></a> + <center>Notebook</center> + </div> + <div class="col-md-3"> + </div> + <div class="col-md-3"> + </div> +</div></p> + + </div> +</div> + + + <hr> + <footer> + <!-- <p>© 2015 The Apache Software Foundation</p>--> + </footer> + </div> + + + + + <script type="text/javascript"> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-45176241-5', 'zeppelin.incubator.apache.org'); + ga('require', 'linkid', 'linkid.js'); + ga('send', 'pageview'); + +</script> + + + + </body> +</html> + Added: incubator/zeppelin/site/docs/0.5.0-incubating/sitemap.txt URL: http://svn.apache.org/viewvc/incubator/zeppelin/site/docs/0.5.0-incubating/sitemap.txt?rev=1715104&view=auto ============================================================================== --- incubator/zeppelin/site/docs/0.5.0-incubating/sitemap.txt (added) +++ incubator/zeppelin/site/docs/0.5.0-incubating/sitemap.txt Thu Nov 19 06:38:15 2015 @@ -0,0 +1,30 @@ + +http://zeppelin.incubator.apache.org/atom.xml +http://zeppelin.incubator.apache.org/development/howtocontribute.html +http://zeppelin.incubator.apache.org/development/howtocontributewebsite.html +http://zeppelin.incubator.apache.org/development/writingzeppelininterpreter.html +http://zeppelin.incubator.apache.org/displaysystem/angular.html +http://zeppelin.incubator.apache.org/displaysystem/display.html +http://zeppelin.incubator.apache.org/displaysystem/table.html +http://zeppelin.incubator.apache.org/docs.html +http://zeppelin.incubator.apache.org/index.html +http://zeppelin.incubator.apache.org/install/install.html +http://zeppelin.incubator.apache.org/install/yarn_install.html +http://zeppelin.incubator.apache.org/interpreter/cassandra.html +http://zeppelin.incubator.apache.org/interpreter/flink.html +http://zeppelin.incubator.apache.org/interpreter/geode.html +http://zeppelin.incubator.apache.org/interpreter/ignite.html +http://zeppelin.incubator.apache.org/interpreter/lens.html +http://zeppelin.incubator.apache.org/interpreter/postgresql.html +http://zeppelin.incubator.apache.org/interpreter/spark.html +http://zeppelin.incubator.apache.org/manual/dynamicform.html +http://zeppelin.incubator.apache.org/manual/interpreters.html +http://zeppelin.incubator.apache.org/manual/notebookashomepage.html +http://zeppelin.incubator.apache.org/pleasecontribute.html +http://zeppelin.incubator.apache.org/rest-api/rest-interpreter.html +http://zeppelin.incubator.apache.org/rest-api/rest-notebook.html +http://zeppelin.incubator.apache.org/rss.xml +http://zeppelin.incubator.apache.org/screenshots.html +http://zeppelin.incubator.apache.org/sitemap.txt +http://zeppelin.incubator.apache.org/storage/storage.html +http://zeppelin.incubator.apache.org/tutorial/tutorial.html Added: incubator/zeppelin/site/docs/0.5.0-incubating/storage/storage.html URL: http://svn.apache.org/viewvc/incubator/zeppelin/site/docs/0.5.0-incubating/storage/storage.html?rev=1715104&view=auto ============================================================================== --- incubator/zeppelin/site/docs/0.5.0-incubating/storage/storage.html (added) +++ incubator/zeppelin/site/docs/0.5.0-incubating/storage/storage.html Thu Nov 19 06:38:15 2015 @@ -0,0 +1,422 @@ + +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Storage</title> + <meta name="description" content="Notebook Storage option for Zeppelin"> + <meta name="author" content="The Apache Software Foundation"> + + <!-- Enable responsive viewport --> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <!-- Le HTML5 shim, for IE6-8 support of HTML elements --> + <!--[if lt IE 9]> + <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> + <![endif]--> + + <!-- Le styles --> + <link href="/assets/themes/zeppelin/bootstrap/css/bootstrap.css" rel="stylesheet"> + <link href="/assets/themes/zeppelin/css/style.css?body=1" rel="stylesheet" type="text/css"> + <link href="/assets/themes/zeppelin/css/syntax.css" rel="stylesheet" type="text/css" media="screen" /> + <!-- Le fav and touch icons --> + <!-- Update these with your own images + <link rel="shortcut icon" href="images/favicon.ico"> + <link rel="apple-touch-icon" href="images/apple-touch-icon.png"> + <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png"> + <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png"> + --> + + <!-- Js --> + <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script> + <script src="/assets/themes/zeppelin/bootstrap/js/bootstrap.min.js"></script> + + <!-- atom & rss feed --> + <link href="/atom.xml" type="application/atom+xml" rel="alternate" title="Sitewide ATOM Feed"> + <link href="/rss.xml" type="application/rss+xml" rel="alternate" title="Sitewide RSS Feed"> + </head> + + <body> + + <div class="navbar navbar-inverse navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="/"> + <img src="/assets/themes/zeppelin/img/zeppelin_logo.png" width="50" alt="I'm zeppelin"> + Zeppelin <small>(0.5.0-incubating)</small> + </a> + </div> + <nav class="navbar-collapse collapse" role="navigation"> + <ul class="nav navbar-nav"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + </ul> + <ul class="nav navbar-nav navbar-right"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs.html">Docs</a></li> + + + + + + + + <li><a href="/index.html">Overview</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + </ul> + </nav><!--/.navbar-collapse --> + </div> + </div> + + + <div class="container"> + +<!--<div class="hero-unit Storage"> + <h1></h1> +</div> +--> + +<div class="row"> + <div class="col-md-12"> + <!-- +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +<h3>Notebook Storage</h3> + +<p>In Zeppelin there are two option for storage Notebook, by default the notebook is storage in the notebook folder in your local File System and the second option is S3.</p> + +<p></br></p> + +<h4>Notebook Storage in S3</h4> + +<p>For notebook storage in S3 you need the AWS credentials, for this there are three options, the enviroment variable <code>AWS_ACCESS_KEY_ID</code> and <code>AWS_ACCESS_SECRET_KEY</code>, credentials file in the folder .aws in you home and IAM role for your instance. For complete the need steps is necessary:</p> + +<p></br> +you need the following folder structure on S3</p> +<div class="highlight"><pre><code class="text language-text" data-lang="text">bucket_name/ + username/ + notebook/ +</code></pre></div> +<p>set the enviroment variable in the file <strong>zeppelin-env.sh</strong>:</p> +<div class="highlight"><pre><code class="text language-text" data-lang="text">export ZEPPELIN_NOTEBOOK_S3_BUCKET = bucket_name +export ZEPPELIN_NOTEBOOK_S3_USER = username +</code></pre></div> +<p>in the file <strong>zeppelin-site.xml</strong> uncommet and complete the next property:</p> +<div class="highlight"><pre><code class="text language-text" data-lang="text"><!--If used S3 to storage, it is necessary the following folder structure bucket_name/username/notebook/--> +<property> + <name>zeppelin.notebook.s3.user</name> + <value>username</value> + <description>user name for s3 folder structure</description> +</property> +<property> + <name>zeppelin.notebook.s3.bucket</name> + <value>bucket_name</value> + <description>bucket name for notebook storage</description> +</property> +</code></pre></div> +<p>uncomment the next property for use S3NotebookRepo class:</p> +<div class="highlight"><pre><code class="text language-text" data-lang="text"><property> + <name>zeppelin.notebook.storage</name> + <value>org.apache.zeppelin.notebook.repo.S3NotebookRepo</value> + <description>notebook persistence layer implementation</description> +</property> +</code></pre></div> +<p>comment the next property:</p> +<div class="highlight"><pre><code class="text language-text" data-lang="text"><property> + <name>zeppelin.notebook.storage</name> + <value>org.apache.zeppelin.notebook.repo.VFSNotebookRepo</value> + <description>notebook persistence layer implementation</description> +</property> +</code></pre></div> + </div> +</div> + + + <hr> + <footer> + <!-- <p>© 2015 The Apache Software Foundation</p>--> + </footer> + </div> + + + + + <script type="text/javascript"> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-45176241-5', 'zeppelin.incubator.apache.org'); + ga('require', 'linkid', 'linkid.js'); + ga('send', 'pageview'); + +</script> + + + + </body> +</html> + Added: incubator/zeppelin/site/docs/0.5.0-incubating/tutorial/tutorial.html URL: http://svn.apache.org/viewvc/incubator/zeppelin/site/docs/0.5.0-incubating/tutorial/tutorial.html?rev=1715104&view=auto ============================================================================== --- incubator/zeppelin/site/docs/0.5.0-incubating/tutorial/tutorial.html (added) +++ incubator/zeppelin/site/docs/0.5.0-incubating/tutorial/tutorial.html Thu Nov 19 06:38:15 2015 @@ -0,0 +1,528 @@ + +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>Tutorial</title> + <meta name="description" content="Tutorial is valid for Spark 1.3 and higher"> + <meta name="author" content="The Apache Software Foundation"> + + <!-- Enable responsive viewport --> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <!-- Le HTML5 shim, for IE6-8 support of HTML elements --> + <!--[if lt IE 9]> + <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> + <![endif]--> + + <!-- Le styles --> + <link href="/assets/themes/zeppelin/bootstrap/css/bootstrap.css" rel="stylesheet"> + <link href="/assets/themes/zeppelin/css/style.css?body=1" rel="stylesheet" type="text/css"> + <link href="/assets/themes/zeppelin/css/syntax.css" rel="stylesheet" type="text/css" media="screen" /> + <!-- Le fav and touch icons --> + <!-- Update these with your own images + <link rel="shortcut icon" href="images/favicon.ico"> + <link rel="apple-touch-icon" href="images/apple-touch-icon.png"> + <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png"> + <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png"> + --> + + <!-- Js --> + <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script> + <script src="/assets/themes/zeppelin/bootstrap/js/bootstrap.min.js"></script> + + <!-- atom & rss feed --> + <link href="/atom.xml" type="application/atom+xml" rel="alternate" title="Sitewide ATOM Feed"> + <link href="/rss.xml" type="application/rss+xml" rel="alternate" title="Sitewide RSS Feed"> + </head> + + <body> + + <div class="navbar navbar-inverse navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="/"> + <img src="/assets/themes/zeppelin/img/zeppelin_logo.png" width="50" alt="I'm zeppelin"> + Zeppelin <small>(0.5.0-incubating)</small> + </a> + </div> + <nav class="navbar-collapse collapse" role="navigation"> + <ul class="nav navbar-nav"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + </ul> + <ul class="nav navbar-nav navbar-right"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs.html">Docs</a></li> + + + + + + + + <li><a href="/index.html">Overview</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + </ul> + </nav><!--/.navbar-collapse --> + </div> + </div> + + + <div class="container"> + +<!--<div class="hero-unit Tutorial"> + <h1></h1> +</div> +--> + +<div class="row"> + <div class="col-md-12"> + <!-- +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +<h3>Zeppelin Tutorial</h3> + +<p>We will assume you have Zeppelin installed already. If that's not the case, see <a href="../install/install.html">Install</a>.</p> + +<p>Zeppelin's current main backend processing engine is <a href="https://spark.apache.org">Apache Spark</a>. If you're new to the system, you might want to start by getting an idea of how it processes data to get the most out of Zeppelin.</p> + +<p><br /></p> + +<h3>Tutorial with Local File</h3> + +<h4>Data Refine</h4> + +<p>Before you start Zeppelin tutorial, you will need to download <a href="http://archive.ics.uci.edu/ml/machine-learning-databases/00222/bank.zip">bank.zip</a>. </p> + +<p>First, to transform data from csv format into RDD of <code>Bank</code> objects, run following script. This will also remove header using <code>filter</code> function.</p> +<div class="highlight"><pre><code class="scala language-scala" data-lang="scala"><span class="k">val</span> <span class="n">bankText</span> <span class="k">=</span> <span class="n">sc</span><span class="o">.</span><span class="n">textFile</span><span class="o">(</span><span class="s">"yourPath/bank/bank-full.csv"</span><span class="o">)</span> + +<span class="k">case</span> <span class="k">class</span> <span class="nc">Bank</span><span class="o">(</span><span class="n">age</span><span class="k">:</span><span class="kt">Integer</span><span class="o">,</span> <span class="n">job</span><span class="k">:</span><span class="kt">String</span><span class="o">,</span> <span class="n">marital</span> <span class="k">:</span> <span class="kt">String</span><span class="o">,</span> <span class="n">education</span> <span class="k">:</span> <span class="kt">String</span><span class="o">,</span> <span class="n">balance</span> <span class="k">:</span> <span class="kt">Integer</span><span class="o">)</span> + +<span class="c1">// split each line, filter out header (starts with "age"), and map it into Bank case class </span> +<span class="k">val</span> <span class="n">bank</span> <span class="k">=</span> <span class="n">bankText</span><span class="o">.</span><span class="n">map</span><span class="o">(</span><span class="n">s</span><span class="k">=></span><span class="n">s</span><span class="o">.</span><span class="n">split</span><span class="o">(</span><span class="s">";"</span><span class="o">)).</span><span class="n">filter</span><span class="o">(</span><span class="n">s</span><span class="k">=></span><span class="n">s</span><span class="o">(</span><span class="mi">0</span><span class="o">)!=</span><span class="s">"\"age\""</span><span class="o">).</span><span class="n">map</span><span class="o">(</span> + <span class="n">s</span><span class="k">=></span><span class="nc">Bank</span><span class="o">(</span><span class="n">s</span><span class="o">(</span><span class="mi">0</span><span class="o">).</span><span class="n">toInt</span><span class="o">,</span> + <span class="n">s</span><span class="o">(</span><span class="mi">1</span><span class="o">).</span><span class="n">replaceAll</span><span class="o">(</span><span class="s">"\""</span><span class="o">,</span> <span class="s">""</span><span class="o">),</span> + <span class="n">s</span><span class="o">(</span><span class="mi">2</span><span class="o">).</span><span class="n">replaceAll</span><span class="o">(</span><span class="s">"\""</span><span class="o">,</span> <span class="s">""</span><span class="o">),</span> + <span class="n">s</span><span class="o">(</span><span class="mi">3</span><span class="o">).</span><span class="n">replaceAll</span><span class="o">(</span><span class="s">"\""</span><span class="o">,</span> <span class="s">""</span><span class="o">),</span> + <span class="n">s</span><span class="o">(</span><span class="mi">5</span><span class="o">).</span><span class="n">replaceAll</span><span class="o">(</span><span class="s">"\""</span><span class="o">,</span> <span class="s">""</span><span class="o">).</span><span class="n">toInt</span> + <span class="o">)</span> +<span class="o">)</span> + +<span class="c1">// convert to DataFrame and create temporal table</span> +<span class="n">bank</span><span class="o">.</span><span class="n">toDF</span><span class="o">().</span><span class="n">registerTempTable</span><span class="o">(</span><span class="s">"bank"</span><span class="o">)</span> +</code></pre></div> +<p><br /></p> + +<h4>Data Retrieval</h4> + +<p>Suppose we want to see age distribution from <code>bank</code>. To do this, run:</p> +<div class="highlight"><pre><code class="sql language-sql" data-lang="sql"><span class="o">%</span><span class="k">sql</span> <span class="k">select</span> <span class="n">age</span><span class="p">,</span> <span class="k">count</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="k">from</span> <span class="n">bank</span> <span class="k">where</span> <span class="n">age</span> <span class="o"><</span> <span class="mi">30</span> <span class="k">group</span> <span class="k">by</span> <span class="n">age</span> <span class="k">order</span> <span class="k">by</span> <span class="n">age</span> +</code></pre></div> +<p>You can make input box for setting age condition by replacing <code>30</code> with <code>${maxAge=30}</code>.</p> +<div class="highlight"><pre><code class="sql language-sql" data-lang="sql"><span class="o">%</span><span class="k">sql</span> <span class="k">select</span> <span class="n">age</span><span class="p">,</span> <span class="k">count</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="k">from</span> <span class="n">bank</span> <span class="k">where</span> <span class="n">age</span> <span class="o"><</span> <span class="err">${</span><span class="n">maxAge</span><span class="o">=</span><span class="mi">30</span><span class="err">}</span> <span class="k">group</span> <span class="k">by</span> <span class="n">age</span> <span class="k">order</span> <span class="k">by</span> <span class="n">age</span> +</code></pre></div> +<p>Now we want to see age distribution with certain marital status and add combo box to select marital status. Run:</p> +<div class="highlight"><pre><code class="sql language-sql" data-lang="sql"><span class="o">%</span><span class="k">sql</span> <span class="k">select</span> <span class="n">age</span><span class="p">,</span> <span class="k">count</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="k">from</span> <span class="n">bank</span> <span class="k">where</span> <span class="n">marital</span><span class="o">=</span><span class="ss">"${marital=single,single|divorced|married}"</span> <span class="k">group</span> <span class="k">by</span> <span class="n">age</span> <span class="k">order</span> <span class="k">by</span> <span class="n">age</span> +</code></pre></div> +<p><br /></p> + +<h3>Tutorial with Streaming Data</h3> + +<h4>Data Refine</h4> + +<p>Since this tutorial is based on Twitter's sample tweet stream, you must configure authentication with a Twitter account. To do this, take a look at <a href="https://databricks-training.s3.amazonaws.com/realtime-processing-with-spark-streaming.html#twitter-credential-setup">Twitter Credential Setup</a>. After you get API keys, you should fill out credential related values(<code>apiKey</code>, <code>apiSecret</code>, <code>accessToken</code>, <code>accessTokenSecret</code>) with your API keys on following script.</p> + +<p>This will create a RDD of <code>Tweet</code> objects and register these stream data as a table:</p> +<div class="highlight"><pre><code class="scala language-scala" data-lang="scala"><span class="k">import</span> <span class="nn">org.apache.spark.streaming._</span> +<span class="k">import</span> <span class="nn">org.apache.spark.streaming.twitter._</span> +<span class="k">import</span> <span class="nn">org.apache.spark.storage.StorageLevel</span> +<span class="k">import</span> <span class="nn">scala.io.Source</span> +<span class="k">import</span> <span class="nn">scala.collection.mutable.HashMap</span> +<span class="k">import</span> <span class="nn">java.io.File</span> +<span class="k">import</span> <span class="nn">org.apache.log4j.Logger</span> +<span class="k">import</span> <span class="nn">org.apache.log4j.Level</span> +<span class="k">import</span> <span class="nn">sys.process.stringSeqToProcess</span> + +<span class="cm">/** Configures the Oauth Credentials for accessing Twitter */</span> +<span class="k">def</span> <span class="n">configureTwitterCredentials</span><span class="o">(</span><span class="n">apiKey</span><span class="k">:</span> <span class="kt">String</span><span class="o">,</span> <span class="n">apiSecret</span><span class="k">:</span> <span class="kt">String</span><span class="o">,</span> <span class="n">accessToken</span><span class="k">:</span> <span class="kt">String</span><span class="o">,</span> <span class="n">accessTokenSecret</span><span class="k">:</span> <span class="kt">String</span><span class="o">)</span> <span class="o">{</span> + <span class="k">val</span> <span class="n">configs</span> <span class="k">=</span> <span class="k">new</span> <span class="nc">HashMap</span><span class="o">[</span><span class="kt">String</span>, <span class="kt">String</span><span class="o">]</span> <span class="o">++=</span> <span class="nc">Seq</span><span class="o">(</span> + <span class="s">"apiKey"</span> <span class="o">-></span> <span class="n">apiKey</span><span class="o">,</span> <span class="s">"apiSecret"</span> <span class="o">-></span> <span class="n">apiSecret</span><span class="o">,</span> <span class="s">"accessToken"</span> <span class="o">-></span> <span class="n">accessToken</span><span class="o">,</span> <span class="s">"accessTokenSecret"</span> <span class="o">-></span> <span class="n">accessTokenSecret</span><span class="o">)</span> + <span class="n">println</span><span class="o">(</span><span class="s">"Configuring Twitter OAuth"</span><span class="o">)</span> + <span class="n">configs</span><span class="o">.</span><span class="n">foreach</span><span class="o">{</span> <span class="k">case</span><span class="o">(</span><span class="n">key</span><span class="o">,</span> <span class="n">value</span><span class="o">)</span> <span class="k">=></span> + <span class="k">if</span> <span class="o">(</span><span class="n">value</span><span class="o">.</span><span class="n">trim</span><span class="o">.</span><span class="n">isEmpty</span><span class="o">)</span> <span class="o">{</span> + <span class="k">throw</span> <span class="k">new</span> <span class="nc">Exception</span><span class="o">(</span><span class="s">"Error setting authentication - value for "</span> <span class="o">+</span> <span class="n">key</span> <span class="o">+</span> <span class="s">" not set"</span><span class="o">)</span> + <span class="o">}</span> + <span class="k">val</span> <span class="n">fullKey</span> <span class="k">=</span> <span class="s">"twitter4j.oauth."</span> <span class="o">+</span> <span class="n">key</span><span class="o">.</span><span class="n">replace</span><span class="o">(</span><span class="s">"api"</span><span class="o">,</span> <span class="s">"consumer"</span><span class="o">)</span> + <span class="nc">System</span><span class="o">.</span><span class="n">setProperty</span><span class="o">(</span><span class="n">fullKey</span><span class="o">,</span> <span class="n">value</span><span class="o">.</span><span class="n">trim</span><span class="o">)</span> + <span class="n">println</span><span class="o">(</span><span class="s">"\tProperty "</span> <span class="o">+</span> <span class="n">fullKey</span> <span class="o">+</span> <span class="s">" set as ["</span> <span class="o">+</span> <span class="n">value</span><span class="o">.</span><span class="n">trim</span> <span class="o">+</span> <span class="s">"]"</span><span class="o">)</span> + <span class="o">}</span> + <span class="n">println</span><span class="o">()</span> +<span class="o">}</span> + +<span class="c1">// Configure Twitter credentials</span> +<span class="k">val</span> <span class="n">apiKey</span> <span class="k">=</span> <span class="s">"xxxxxxxxxxxxxxxxxxxxxxxxx"</span> +<span class="k">val</span> <span class="n">apiSecret</span> <span class="k">=</span> <span class="s">"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"</span> +<span class="k">val</span> <span class="n">accessToken</span> <span class="k">=</span> <span class="s">"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"</span> +<span class="k">val</span> <span class="n">accessTokenSecret</span> <span class="k">=</span> <span class="s">"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"</span> +<span class="n">configureTwitterCredentials</span><span class="o">(</span><span class="n">apiKey</span><span class="o">,</span> <span class="n">apiSecret</span><span class="o">,</span> <span class="n">accessToken</span><span class="o">,</span> <span class="n">accessTokenSecret</span><span class="o">)</span> + +<span class="k">import</span> <span class="nn">org.apache.spark.streaming.twitter._</span> +<span class="k">val</span> <span class="n">ssc</span> <span class="k">=</span> <span class="k">new</span> <span class="nc">StreamingContext</span><span class="o">(</span><span class="n">sc</span><span class="o">,</span> <span class="nc">Seconds</span><span class="o">(</span><span class="mi">2</span><span class="o">))</span> +<span class="k">val</span> <span class="n">tweets</span> <span class="k">=</span> <span class="nc">TwitterUtils</span><span class="o">.</span><span class="n">createStream</span><span class="o">(</span><span class="n">ssc</span><span class="o">,</span> <span class="nc">None</span><span class="o">)</span> +<span class="k">val</span> <span class="n">twt</span> <span class="k">=</span> <span class="n">tweets</span><span class="o">.</span><span class="n">window</span><span class="o">(</span><span class="nc">Seconds</span><span class="o">(</span><span class="mi">60</span><span class="o">))</span> + +<span class="k">case</span> <span class="k">class</span> <span class="nc">Tweet</span><span class="o">(</span><span class="n">createdAt</span><span class="k">:</span><span class="kt">Long</span><span class="o">,</span> <span class="n">text</span><span class="k">:</span><span class="kt">String</span><span class="o">)</span> +<span class="n">twt</span><span class="o">.</span><span class="n">map</span><span class="o">(</span><span class="n">status</span><span class="k">=></span> + <span class="nc">Tweet</span><span class="o">(</span><span class="n">status</span><span class="o">.</span><span class="n">getCreatedAt</span><span class="o">().</span><span class="n">getTime</span><span class="o">()/</span><span class="mi">1000</span><span class="o">,</span> <span class="n">status</span><span class="o">.</span><span class="n">getText</span><span class="o">())</span> +<span class="o">).</span><span class="n">foreachRDD</span><span class="o">(</span><span class="n">rdd</span><span class="k">=></span> + <span class="c1">// Below line works only in spark 1.3.0.</span> + <span class="c1">// For spark 1.1.x and spark 1.2.x,</span> + <span class="c1">// use rdd.registerTempTable("tweets") instead.</span> + <span class="n">rdd</span><span class="o">.</span><span class="n">toDF</span><span class="o">().</span><span class="n">registerAsTable</span><span class="o">(</span><span class="s">"tweets"</span><span class="o">)</span> +<span class="o">)</span> + +<span class="n">twt</span><span class="o">.</span><span class="n">print</span> + +<span class="n">ssc</span><span class="o">.</span><span class="n">start</span><span class="o">()</span> +</code></pre></div> +<p><br /></p> + +<h4>Data Retrieval</h4> + +<p>For each following script, every time you click run button you will see different result since it is based on real-time data.</p> + +<p>Let's begin by extracting maximum 10 tweets which contain the word "girl".</p> +<div class="highlight"><pre><code class="sql language-sql" data-lang="sql"><span class="o">%</span><span class="k">sql</span> <span class="k">select</span> <span class="o">*</span> <span class="k">from</span> <span class="n">tweets</span> <span class="k">where</span> <span class="nb">text</span> <span class="k">like</span> <span class="s1">'%girl%'</span> <span class="k">limit</span> <span class="mi">10</span> +</code></pre></div> +<p>This time suppose we want to see how many tweets have been created per sec during last 60 sec. To do this, run:</p> +<div class="highlight"><pre><code class="sql language-sql" data-lang="sql"><span class="o">%</span><span class="k">sql</span> <span class="k">select</span> <span class="n">createdAt</span><span class="p">,</span> <span class="k">count</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="k">from</span> <span class="n">tweets</span> <span class="k">group</span> <span class="k">by</span> <span class="n">createdAt</span> <span class="k">order</span> <span class="k">by</span> <span class="n">createdAt</span> +</code></pre></div> +<p>You can make user-defined function and use it in Spark SQL. Let's try it by making function named <code>sentiment</code>. This function will return one of the three attitudes(positive, negative, neutral) towards the parameter.</p> +<div class="highlight"><pre><code class="scala language-scala" data-lang="scala"><span class="k">def</span> <span class="n">sentiment</span><span class="o">(</span><span class="n">s</span><span class="k">:</span><span class="kt">String</span><span class="o">)</span> <span class="k">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="o">{</span> + <span class="k">val</span> <span class="n">positive</span> <span class="k">=</span> <span class="nc">Array</span><span class="o">(</span><span class="s">"like"</span><span class="o">,</span> <span class="s">"love"</span><span class="o">,</span> <span class="s">"good"</span><span class="o">,</span> <span class="s">"great"</span><span class="o">,</span> <span class="s">"happy"</span><span class="o">,</span> <span class="s">"cool"</span><span class="o">,</span> <span class="s">"the"</span><span class="o">,</span> <span class="s">"one"</span><span class="o">,</span> <span class="s">"that"</span><span class="o">)</span> + <span class="k">val</span> <span class="n">negative</span> <span class="k">=</span> <span class="nc">Array</span><span class="o">(</span><span class="s">"hate"</span><span class="o">,</span> <span class="s">"bad"</span><span class="o">,</span> <span class="s">"stupid"</span><span class="o">,</span> <span class="s">"is"</span><span class="o">)</span> + + <span class="k">var</span> <span class="n">st</span> <span class="k">=</span> <span class="mi">0</span><span class="o">;</span> + + <span class="k">val</span> <span class="n">words</span> <span class="k">=</span> <span class="n">s</span><span class="o">.</span><span class="n">split</span><span class="o">(</span><span class="s">" "</span><span class="o">)</span> + <span class="n">positive</span><span class="o">.</span><span class="n">foreach</span><span class="o">(</span><span class="n">p</span> <span class="k">=></span> + <span class="n">words</span><span class="o">.</span><span class="n">foreach</span><span class="o">(</span><span class="n">w</span> <span class="k">=></span> + <span class="k">if</span><span class="o">(</span><span class="n">p</span><span class="o">==</span><span class="n">w</span><span class="o">)</span> <span class="n">st</span> <span class="k">=</span> <span class="n">st</span><span class="o">+</span><span class="mi">1</span> + <span class="o">)</span> + <span class="o">)</span> + + <span class="n">negative</span><span class="o">.</span><span class="n">foreach</span><span class="o">(</span><span class="n">p</span><span class="k">=></span> + <span class="n">words</span><span class="o">.</span><span class="n">foreach</span><span class="o">(</span><span class="n">w</span><span class="k">=></span> + <span class="k">if</span><span class="o">(</span><span class="n">p</span><span class="o">==</span><span class="n">w</span><span class="o">)</span> <span class="n">st</span> <span class="k">=</span> <span class="n">st</span><span class="o">-</span><span class="mi">1</span> + <span class="o">)</span> + <span class="o">)</span> + <span class="k">if</span><span class="o">(</span><span class="n">st</span><span class="o">></span><span class="mi">0</span><span class="o">)</span> + <span class="s">"positivie"</span> + <span class="k">else</span> <span class="k">if</span><span class="o">(</span><span class="n">st</span><span class="o"><</span><span class="mi">0</span><span class="o">)</span> + <span class="s">"negative"</span> + <span class="k">else</span> + <span class="s">"neutral"</span> +<span class="o">}</span> + +<span class="c1">// Below line works only in spark 1.3.0.</span> +<span class="c1">// For spark 1.1.x and spark 1.2.x,</span> +<span class="c1">// use sqlc.registerFunction("sentiment", sentiment _) instead.</span> +<span class="n">sqlc</span><span class="o">.</span><span class="n">udf</span><span class="o">.</span><span class="n">register</span><span class="o">(</span><span class="s">"sentiment"</span><span class="o">,</span> <span class="n">sentiment</span> <span class="k">_</span><span class="o">)</span> +</code></pre></div> +<p>To check how people think about girls using <code>sentiment</code> function we've made above, run this:</p> +<div class="highlight"><pre><code class="sql language-sql" data-lang="sql"><span class="o">%</span><span class="k">sql</span> <span class="k">select</span> <span class="n">sentiment</span><span class="p">(</span><span class="nb">text</span><span class="p">),</span> <span class="k">count</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="k">from</span> <span class="n">tweets</span> <span class="k">where</span> <span class="nb">text</span> <span class="k">like</span> <span class="s1">'%girl%'</span> <span class="k">group</span> <span class="k">by</span> <span class="n">sentiment</span><span class="p">(</span><span class="nb">text</span><span class="p">)</span> +</code></pre></div> + </div> +</div> + + + <hr> + <footer> + <!-- <p>© 2015 The Apache Software Foundation</p>--> + </footer> + </div> + + + + + <script type="text/javascript"> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-45176241-5', 'zeppelin.incubator.apache.org'); + ga('require', 'linkid', 'linkid.js'); + ga('send', 'pageview'); + +</script> + + + + </body> +</html> + Added: incubator/zeppelin/site/docs/0.5.5-incubating/404.html URL: http://svn.apache.org/viewvc/incubator/zeppelin/site/docs/0.5.5-incubating/404.html?rev=1715104&view=auto ============================================================================== --- incubator/zeppelin/site/docs/0.5.5-incubating/404.html (added) +++ incubator/zeppelin/site/docs/0.5.5-incubating/404.html Thu Nov 19 06:38:15 2015 @@ -0,0 +1 @@ +Sorry this page does not exist =( Added: incubator/zeppelin/site/docs/0.5.5-incubating/Gemfile URL: http://svn.apache.org/viewvc/incubator/zeppelin/site/docs/0.5.5-incubating/Gemfile?rev=1715104&view=auto ============================================================================== --- incubator/zeppelin/site/docs/0.5.5-incubating/Gemfile (added) +++ incubator/zeppelin/site/docs/0.5.5-incubating/Gemfile Thu Nov 19 06:38:15 2015 @@ -0,0 +1,17 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +source 'https://rubygems.org' +gem 'github-pages' Added: incubator/zeppelin/site/docs/0.5.5-incubating/Gemfile.lock URL: http://svn.apache.org/viewvc/incubator/zeppelin/site/docs/0.5.5-incubating/Gemfile.lock?rev=1715104&view=auto ============================================================================== --- incubator/zeppelin/site/docs/0.5.5-incubating/Gemfile.lock (added) +++ incubator/zeppelin/site/docs/0.5.5-incubating/Gemfile.lock Thu Nov 19 06:38:15 2015 @@ -0,0 +1,61 @@ +GEM + remote: https://rubygems.org/ + specs: + RedCloth (4.2.9) + classifier (1.3.3) + fast-stemmer (>= 1.0.0) + colorator (0.1) + commander (4.1.5) + highline (~> 1.6.11) + fast-stemmer (1.0.2) + ffi (1.9.3) + github-pages (10) + RedCloth (= 4.2.9) + jekyll (= 1.3.0) + kramdown (= 1.2.0) + liquid (= 2.5.4) + maruku (= 0.6.1) + rdiscount (= 2.1.7) + redcarpet (= 2.3.0) + highline (1.6.20) + jekyll (1.3.0) + classifier (~> 1.3) + colorator (~> 0.1) + commander (~> 4.1.3) + liquid (~> 2.5.2) + listen (~> 1.3) + maruku (~> 0.6.0) + pygments.rb (~> 0.5.0) + redcarpet (~> 2.3.0) + safe_yaml (~> 0.9.7) + kramdown (1.2.0) + liquid (2.5.4) + listen (1.3.1) + rb-fsevent (>= 0.9.3) + rb-inotify (>= 0.9) + rb-kqueue (>= 0.2) + maruku (0.6.1) + syntax (>= 1.0.0) + posix-spawn (0.3.6) + pygments.rb (0.5.4) + posix-spawn (~> 0.3.6) + yajl-ruby (~> 1.1.0) + rb-fsevent (0.9.3) + rb-inotify (0.9.2) + ffi (>= 0.5.0) + rb-kqueue (0.2.0) + ffi (>= 0.5.0) + rdiscount (2.1.7) + redcarpet (2.3.0) + safe_yaml (0.9.7) + syntax (1.0.0) + yajl-ruby (1.1.0) + +PLATFORMS + ruby + +DEPENDENCIES + github-pages + +BUNDLED WITH + 1.10.4
