Merge branch 'master' into ZEPPELIN-732-up

This commit is contained in:
Lee moon soo 2016-06-15 13:58:44 -07:00
commit 6c5019e0f4
38 changed files with 698 additions and 248 deletions

View file

@ -109,7 +109,6 @@ The top-level pom.xml describes the basic project structure. Currently Zeppelin
<module>markdown</module>
<module>angular</module>
<module>shell</module>
<module>hive</module>
<module>flink</module>
<module>ignite</module>
<module>lens</module>

View file

@ -18,28 +18,34 @@
<li>
<a href="#" data-toggle="dropdown" class="dropdown-toggle">Quick Start <b class="caret"></b></a>
<ul class="dropdown-menu">
<!-- li><span><b>Overview</b><span></li -->
<li><a href="{{BASE_PATH}}/index.html">Overview</a></li>
<li><a href="{{BASE_PATH}}/index.html">What is Apache Zeppelin ?</a></li>
<li role="separator" class="divider"></li>
<li class="title"><span><b>Getting Started</b><span></li>
<li><a href="{{BASE_PATH}}/install/install.html">Quick Start</a></li>
<li><a href="{{BASE_PATH}}/install/install.html#zeppelin-configuration">Configuration</a></li>
<li><a href="{{BASE_PATH}}/quickstart/explorezeppelinui.html">Explore Zeppelin UI</a></li>
<li><a href="{{BASE_PATH}}/quickstart/tutorial.html">Tutorial</a></li>
<li role="separator" class="divider"></li>
<!-- li><span><b>Install</b><span></li -->
<li><a href="{{BASE_PATH}}/install/install.html">Install</a></li>
<li><a href="{{BASE_PATH}}/install/yarn_install.html">YARN Install</a></li>
<li><a href="{{BASE_PATH}}/install/virtual_machine.html">Virtual Machine Install</a></li>
<li role="separator" class="divider"></li>
<li><a href="{{BASE_PATH}}/install/upgrade.html">Upgrade Version</a></li>
<li role="separator" class="divider"></li>
<!-- li><span><b>Guide</b><span></li -->
<li class="title"><span><b>Basic Feature Guide</b><span></li>
<li><a href="{{BASE_PATH}}/manual/dynamicform.html">Dynamic Form</a></li>
<li><a href="{{BASE_PATH}}/manual/publish.html">Publish your Paragraph</a></li>
<li><a href="{{BASE_PATH}}/manual/notebookashomepage.html">Customize Zeppelin Homepage</a></li>
<li role="separator" class="divider"></li>
<li class="title"><span><b>More</b><span></li>
<li><a href="{{BASE_PATH}}/install/virtual_machine.html">Zeppelin on Vagrant VM</a></li>
<li><a href="{{BASE_PATH}}/install/upgrade.html">Upgrade Zeppelin Version</a></li>
</ul>
</li>
<li>
<a href="#" data-toggle="dropdown" class="dropdown-toggle">Interpreter <b class="caret"></b></a>
<ul class="dropdown-menu">
<ul class="dropdown-menu scrollable-menu">
<li><a href="{{BASE_PATH}}/manual/interpreters.html">Overview</a></li>
<li role="separator" class="divider"></li>
<li class="title"><span><b>Usage</b><span></li>
<li><a href="{{BASE_PATH}}/manual/dynamicinterpreterload.html">Dynamic Interpreter Loading</a></li>
<li><a href="{{BASE_PATH}}/manual/dependencymanagement.html">Interpreter Dependency Management</a></li>
<li role="separator" class="divider"></li>
<li class="title"><span><b>Available Interpreters</b><span></li>
<li><a href="{{BASE_PATH}}/interpreter/alluxio.html">Alluxio</a></li>
<li><a href="{{BASE_PATH}}/interpreter/cassandra.html">Cassandra</a></li>
<li><a href="{{BASE_PATH}}/interpreter/elasticsearch.html">Elasticsearch</a></li>
@ -59,45 +65,42 @@
<li><a href="{{BASE_PATH}}/interpreter/scalding.html">Scalding</a></li>
<li><a href="{{BASE_PATH}}/pleasecontribute.html">Shell</a></li>
<li><a href="{{BASE_PATH}}/interpreter/spark.html">Spark</a></li>
<li role="separator" class="divider"></li>
<li><a href="{{BASE_PATH}}/manual/dynamicinterpreterload.html">Dynamic Interpreter Loading</a></li>
<li><a href="{{BASE_PATH}}/manual/dependencymanagement.html">Interpreter Dependency Management</a></li>
</ul>
</li>
<li>
<a href="#" data-toggle="dropdown" class="dropdown-toggle">Display System <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="{{BASE_PATH}}/displaysystem/text.html">Text</a></li>
<li><a href="{{BASE_PATH}}/displaysystem/html.html">Html</a></li>
<li><a href="{{BASE_PATH}}/displaysystem/table.html">Table</a></li>
<li class="title"><span><b>Basic Display System</b><span></li>
<li><a href="{{BASE_PATH}}/displaysystem/basicdisplaysystem.html#text">Text</a></li>
<li><a href="{{BASE_PATH}}/displaysystem/basicdisplaysystem.html#html">Html</a></li>
<li><a href="{{BASE_PATH}}/displaysystem/basicdisplaysystem.html#table">Table</a></li>
<li role="separator" class="divider"></li>
<li class="title"><span><b>Angular API</b><span></li>
<li><a href="{{BASE_PATH}}/displaysystem/back-end-angular.html">Angular (backend API)</a></li>
<li><a href="{{BASE_PATH}}/displaysystem/front-end-angular.html">Angular (frontend API)</a></li>
</ul>
</li>
<li>
<a href="#" data-toggle="dropdown" class="dropdown-toggle">More <b class="caret"></b></a>
<ul class="dropdown-menu">
<!-- li><span><b>Manual</b><span></li -->
<li><a href="{{BASE_PATH}}/manual/notebookashomepage.html">Notebook as Homepage</a></li>
<a href="#" data-toggle="dropdown" class="dropdown-toggle">More<b class="caret"></b></a>
<ul class="dropdown-menu scrollable-menu" style="right: 0; left: auto;">
<li class="title"><span><b>Notebook Storage</b><span></li>
<li><a href="{{BASE_PATH}}/storage/storage.html#notebook-storage-in-local-git-repository">Git Storage</a></li>
<li><a href="{{BASE_PATH}}/storage/storage.html#notebook-storage-in-s3">S3 Storage</a></li>
<li><a href="{{BASE_PATH}}/storage/storage.html#notebook-storage-in-azure">Azure Storage</a></li>
<li><a href="{{BASE_PATH}}/storage/storage.html#storage-in-zeppelinhub">ZeppelinHub Storage</a></li>
<li role="separator" class="divider"></li>
<!-- li><span><b>Notebook Storage</b><span></li -->
<li><a href="{{BASE_PATH}}/storage/storage.html#Git">Git Storage</a></li>
<li><a href="{{BASE_PATH}}/storage/storage.html#S3">S3 Storage</a></li>
<li><a href="{{BASE_PATH}}/storage/storage.html#Azure">Azure Storage</a></li>
<li><a href="{{BASE_PATH}}/storage/storage.html#ZeppelinHub">ZeppelinHub Storage</a></li>
<li role="separator" class="divider"></li>
<!-- li><span><b>REST API</b><span></li -->
<li class="title"><span><b>REST API</b><span></li>
<li><a href="{{BASE_PATH}}/rest-api/rest-interpreter.html">Interpreter API</a></li>
<li><a href="{{BASE_PATH}}/rest-api/rest-notebook.html">Notebook API</a></li>
<li><a href="{{BASE_PATH}}/rest-api/rest-configuration.html">Configuration API</a></li>
<li role="separator" class="divider"></li>
<!-- li><span><b>Security</b><span></li -->
<li class="title"><span><b>Security</b><span></li>
<li><a href="{{BASE_PATH}}/security/authentication.html">Authentication for NGINX</a></li>
<li><a href="{{BASE_PATH}}/security/shiroauthentication.html">Shiro Authentication</a></li>
<li><a href="{{BASE_PATH}}/security/notebook_authorization.html">Notebook Authorization</a></li>
<li><a href="{{BASE_PATH}}/security/interpreter_authorization.html">Interpreter Authorization</a></li>
<li><a href="{{BASE_PATH}}/security/interpreter_authorization.html">Interpreter & Data Resource Authorization</a></li>
<li role="separator" class="divider"></li>
<!-- li><span><b>Development</b><span></li -->
<li class="title"><span><b>Contibute</b><span></li>
<li><a href="{{BASE_PATH}}/development/writingzeppelininterpreter.html">Writing Zeppelin Interpreter</a></li>
<li><a href="{{BASE_PATH}}/development/writingzeppelinapplication.html">Writing Zeppelin Application</a></li>
<li><a href="{{BASE_PATH}}/development/howtocontribute.html">How to contribute (code)</a></li>

View file

@ -136,6 +136,23 @@ body {
background: #3071a9;
}
.scrollable-menu {
max-height: 500px;
overflow: auto;
}
.index-header {
font-size: 16px;
font-style: italic;
margin-bottom: 15px;
margin-top: 15px;
}
.index-description {
line-height: 1.6;
padding: 10px;
}
@media (max-width: 768px) {
.navbar-collapse.in {
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.4);
@ -561,6 +578,11 @@ and (max-width: 1024px) {
font-size: 13px;
}
#menu .title {
padding-bottom: 8px;
color: #3071a9;
}
#menu .caret {
border-top-color: white;
border-bottom-color: white;
@ -585,3 +607,15 @@ and (max-width: 1024px) {
padding: 3px 10px 10px 10px;
font-size: 13px;
}
@media only screen and (max-width: 480px) {
#menu .title {
color: #bbb;
}
}
@media only screen and (max-width: 768px) {
#menu .title {
color: #bbb;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 342 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 549 KiB

View file

@ -1,6 +1,6 @@
---
layout: page
title: "Table Display System"
title: "Basic Display System"
description: ""
group: display
---
@ -19,18 +19,34 @@ limitations under the License.
-->
{% include JB/setup %}
## Text
By default, Apache Zeppelin prints interpreter responce as a plain text using `text` display system.
<img src="/assets/themes/zeppelin/img/screenshots/display_text.png" />
You can explicitly say you're using `text` display system.
<img src="/assets/themes/zeppelin/img/screenshots/display_text1.png" />
## Html
With `%html` directive, Zeppelin treats your output as HTML
<img src="/assets/themes/zeppelin/img/screenshots/display_html.png" />
## Table
If you have data that row seprated by '\n' (newline) and column separated by '\t' (tab) with first row as header row, for example
<img src="/assets/themes/zeppelin/img/screenshots/display_table.png" />
You can simply use %table display system to leverage Zeppelin's built in visualization.
You can simply use `%table` display system to leverage Zeppelin's built in visualization.
<img src="/assets/themes/zeppelin/img/screenshots/display_table1.png" />
Note that display system is backend independent.
If table contents start with %html, it is interpreted as an HTML.
If table contents start with `%html`, it is interpreted as an HTML.
<img src="/assets/themes/zeppelin/img/screenshots/display_table_html.png" />
> **Note :** Display system is backend independent.

View file

@ -1,25 +0,0 @@
---
layout: page
title: "Html Display System"
description: ""
group: display
---
<!--
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.
-->
{% include JB/setup %}
## Html
With '%html' directive, Zeppelin treats your output as html
<img src="/assets/themes/zeppelin/img/screenshots/display_html.png" />

View file

@ -1,31 +0,0 @@
---
layout: page
title: "Text Display System"
description: ""
group: display
---
<!--
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.
-->
{% include JB/setup %}
## Text
Zeppelin prints output of language backend in text, by default.
<img src="/assets/themes/zeppelin/img/screenshots/display_text.png" />
You can explicitly say you're using text display system.
<img src="/assets/themes/zeppelin/img/screenshots/display_text1.png" />
Note that display system is backend independent.

View file

@ -20,50 +20,49 @@ limitations under the License.
{% include JB/setup %}
<br />
<div class="row">
<div class="col-md-6">
<h2>Multi-purpose Notebook</h2>
<p style="font-size:16px; color:#555555;font-style:italic;margin-bottom: 15px;">
The Notebook is the place for all your needs
</p>
<ul style="list-style-type: none;padding-left:10px;" >
<li style="font-size:20px; margin: 5px;"><span class="glyphicon glyphicon-import"></span> Data Ingestion</li>
<li style="font-size:20px; margin: 5px;"><span class="glyphicon glyphicon-eye-open"></span> Data Discovery</li>
<li style="font-size:20px; margin: 5px;"><span class="glyphicon glyphicon-wrench"></span> Data Analytics</li>
<li style="font-size:20px; margin: 5px;"><span class="glyphicon glyphicon-dashboard"></span> Data Visualization & Collaboration</li>
</ul>
</div>
<div class="col-md-6"><img class="img-responsive" style="border: 1px solid #ecf0f1;" height="auto" src="/assets/themes/zeppelin/img/notebook.png" /></div>
<div class="col-md-6" style="padding-right:0">
<h1 style="color:#4c555a">Multi-purpose Notebook</h1>
<p class="index-header">
The Notebook is the place for all your needs
</p>
<ul style="list-style-type: none;padding-left:10px;" >
<li style="font-size:18px; margin: 5px;"><span class="glyphicon glyphicon-import" style="margin-right:10px"></span> Data Ingestion</li>
<li style="font-size:18px; margin: 5px;"><span class="glyphicon glyphicon-eye-open" style="margin-right:10px"></span> Data Discovery</li>
<li style="font-size:18px; margin: 5px;"><span class="glyphicon glyphicon-wrench" style="margin-right:10px"></span> Data Analytics</li>
<li style="font-size:18px; margin: 5px;"><span class="glyphicon glyphicon-dashboard" style="margin-right:10px"></span> Data Visualization & Collaboration</li>
</ul>
</div>
<div class="col-md-6" style="padding:0">
<img class="img-responsive" style="border: 1px solid #ecf0f1;" src="/assets/themes/zeppelin/img/notebook.png" />
</div>
</div>
<br />
### Multiple language backend
## Multiple Language Backend
[Apache Zeppelin interpreter](./manual/interpreters.html) concept allows any language/data-processing-backend to be plugged into Zeppelin.
Currently Apache Zeppelin supports many interpreters such as Apache Spark, Python, JDBC, Markdown and Shell.
Zeppelin interpreter concept allows any language/data-processing-backend to be plugged into Zeppelin.
Currently Zeppelin supports many interpreters such as Scala(with Apache Spark), Python(with Apache Spark), SparkSQL, JDBC, Markdown and Shell.
<img class="img-responsive" width="500px" style="margin:0 auto; padding: 26px;" src="/assets/themes/zeppelin/img/available_interpreters.png" />
<img class="img-responsive" src="/assets/themes/zeppelin/img/screenshots/multiple_language_backend.png" />
Adding new language-backend is really simple. Learn [how to create your own interpreter](./development/writingzeppelininterpreter.html#make-your-own-interpreter).
Adding new language-backend is really simple. Learn [how to write a zeppelin interpreter](./development/writingzeppelininterpreter.html).
#### Apache Spark integration
Especially, Apache Zeppelin provides built-in [Apache Spark](http://spark.apache.org/) integration. You don't need to build a separate module, plugin or library for it.
<br />
### Apache Spark integration
<img class="img-responsive" src="/assets/themes/zeppelin/img/spark_logo.jpg" width="140px" />
Zeppelin provides built-in Apache Spark integration. You don't need to build a separate module, plugin or library for it.
<img src="/assets/themes/zeppelin/img/spark_logo.jpg" width="80px" />
Zeppelin's Spark integration provides
Apache Zeppelin with Spark integration provides
- Automatic SparkContext and SQLContext injection
- Runtime jar dependency loading from local filesystem or maven repository. Learn more about [dependency loader](./interpreter/spark.html#dependencyloading).
- Canceling job and displaying its progress
<br />
### Data visualization
For the further information about Apache Spark in Apache Zeppelin, please see [Spark interpreter for Apache Zeppelin](./interpreter/spark.html).
Some basic charts are already included in Zeppelin. Visualizations are not limited to SparkSQL's query, any output from any language backend can be recognized and visualized.
<br />
## Data visualization
Some basic charts are already included in Apache Zeppelin. Visualizations are not limited to SparkSQL query, any output from any language backend can be recognized and visualized.
<div class="row">
<div class="col-md-6">
@ -74,49 +73,108 @@ Some basic charts are already included in Zeppelin. Visualizations are not limit
</div>
</div>
#### Pivot chart
### Pivot chart
With simple drag and drop Zeppelin aggregates the values and display them in pivot chart. You can easily create chart with multiple aggregated values including sum, count, average, min, max.
Apache Zeppelin aggregates values and displays them in pivot chart with simple drag and drop. You can easily create chart with multiple aggregated values including sum, count, average, min, max.
<div class="row">
<div class="col-md-8">
<img class="img-responsive" src="/assets/themes/zeppelin/img/screenshots/pivot.png" />
<div class="col-md-12">
<img class="img-responsive" style="margin: 16px auto;" src="/assets/themes/zeppelin/img/screenshots/pivot.png" width="480px" />
</div>
</div>
Learn more about Zeppelin's Display system. ( [text](./displaysystem/display.html), [html](./displaysystem/display.html#html), [table](./displaysystem/table.html), [angular](./displaysystem/angular.html) )
Learn more about [display systems](#display-system) in Apache Zeppelin.
<br />
### Dynamic forms
Zeppelin can dynamically create some input forms into your notebook.
<img class="img-responsive" src="/assets/themes/zeppelin/img/screenshots/form_input.png" />
## Dynamic forms
Apache Zeppelin can dynamically create some input forms in your notebook.
<div class="row">
<div class="col-md-12">
<img class="img-responsive" style="margin: 16px auto;" src="/assets/themes/zeppelin/img/screenshots/dynamicform.png" />
</div>
</div>
Learn more about [Dynamic Forms](./manual/dynamicform.html).
<br />
### Collaboration
Notebook URL can be shared among collaborators. Zeppelin can then broadcast any changes in realtime, just like the collaboration in Google docs.
<img src="/assets/themes/zeppelin/img/screenshots/collaboration.png" />
<br />
### Publish
<p>Zeppelin provides an URL to display the result only, that page does not include Zeppelin's menu and buttons.
This way, you can easily embed it as an iframe inside of your website.</p>
## Collaborate by sharing your Notebook & Paragraph
Your notebook URL can be shared among collaborators. Then Apache Zeppelin will broadcast any changes in realtime, just like the collaboration in Google docs.
<div class="row">
<img class="img-responsive center-block" src="/assets/themes/zeppelin/img/screenshots/publish.png" />
<div class="col-md-12">
<img class="img-responsive" style="margin: 20px auto" src="/assets/themes/zeppelin/img/screenshots/publish.png" width="650px"/>
</div>
</div>
Apache Zeppelin provides an URL to display the result only, that page does not include any menus and buttons inside of notebooks.
You can easily embed it as an iframe inside of your website in this way.
If you want to learn more about this feature, please visit [this page](./manual/publish.html).
<br />
### 100% Opensource
## 100% Opensource
Apache Zeppelin is Apache2 Licensed software. Please check out the [source repository](http://git.apache.org/zeppelin.git) and [How to contribute](./development/howtocontribute.html)
<img class="img-responsive" style="margin:0 auto; padding: 15px;" src="/assets/themes/zeppelin/img/asf_logo.png" width="250px"/>
Apache Zeppelin is Apache2 Licensed software. Please check out the [source repository](http://git.apache.org/zeppelin.git) and [how to contribute](./development/howtocontribute.html).
Apache Zeppelin has a very active development community.
Join to our [Mailing list](https://zeppelin.apache.org/community.html) and report issues on [Jira Issue tracker](https://issues.apache.org/jira/browse/ZEPPELIN).
## What is the next ?
####Quick Start
* Getting Started
* [Quick Start](./install/install.html) for basic instructions on installing Zeppelin
* [Configuration](./install/install.html#zeppelin-configuration) lists for Zeppelin
* [Explore Apache Zeppelin UI](./quickstart/explorezeppelinui.html): basic components of Zeppelin home
* [Tutorial](./quickstart/tutorial.html): a short walk-through tutorial that uses Apache Spark backend
* Basic Feature Guide
* [Dynamic Form](./manual/dynamicform.html): a step by step guide for creating dynamic forms
* [Publish your Paragraph](./manual/publish.html) results into your external website
* [Customize Zeppelin Homepage](./manual/notebookashomepage.html) with one of your notebooks
* More
* [Apache Zeppelin on Vagrant VM](./install/virtual_machine.html): a guide for installing Apache Zeppelin on Vagrant virtual machine
* [Upgrade Apache Zeppelin Version](./install/upgrade.html): a manual procedure of upgrading Apache Zeppelin version
####Interpreter
* [Interpreters in Apache Zeppelin](./manual/interpreters.html): what is interpreter group? how can you set interpreters in Apache Zeppelin?
* Available Interpreters: currently, about 20 interpreters are available in Apache Zeppelin.
* Usage
* [Dynamic Interpreter Loading](./manual/dynamicinterpreterload.html) using REST API
* [Interpreter Dependency Management](./manual/dependencymanagement.html) when you include external libraries to interpreter
####Display System
* Basic Display System: [Text](./displaysystem/basicdisplaysystem.html#text), [HTML](./displaysystem/basicdisplaysystem.html#html), [Table](./displaysystem/basicdisplaysystem.html#table) is available
* Angular API: a description about avilable backend and frontend AngularJS API with examples
* [Angular (backend API)](./displaysystem/back-end-angular.html)
* [Angular (frontend API)](./displaysystem/front-end-angular.html)
####More
* Notebook Storage: a guide about saving notebooks to external storage
* [Git Storage](./storage/storage.html#notebook-storage-in-local-git-repository)
* [S3 Storage](./storage/storage.html#notebook-storage-in-s3)
* [Azure Storage](./storage/storage.html#notebook-storage-in-azure)
* [ZeppelinHub Storage](./storage/storage.html#storage-in-zeppelinhub)
* REST API: available REST API list in Apache Zeppelin
* [Interpreter API](./rest-api/rest-interpreter.html)
* [Notebook API](./rest-api/rest-notebook.html)
* [Configuration API](./rest-api/rest-configuration.html)
* Security: available security support in Apache Zeppelin
* [Authentication for NGINX](./security/authentication.html)
* [Shiro Authentication](./security/shiroauthentication.html)
* [Notebook Authorization](./security/notebook_authorization.html)
* [Interpreter & Data Resource Authorization](./security/interpreter_authorization.html)
* Contribute
* [Writing a new Interpreter](./development/writingzeppelininterpreter.html)
* [How to contribute (code)](./development/howtocontribute.html)
* [How to contribute (documentation website)](./development/howtocontributewebsite.html)
#### External Resources
* [Mailing List](https://zeppelin.apache.org/community.html)
* [Apache Zeppelin Wiki](https://cwiki.apache.org/confluence/display/ZEPPELIN/Zeppelin+Home)
* [StackOverflow tag `apache-zeppelin`](http://stackoverflow.com/questions/tagged/apache-zeppelin)
Zeppelin has a very active development community.
Join the [Mailing list](https://zeppelin.apache.org/community.html) and report issues on our [Issue tracker](https://issues.apache.org/jira/browse/ZEPPELIN).

View file

@ -1,6 +1,6 @@
---
layout: page
title: "Zeppelin Installation"
title: "Getting Started"
description: ""
group: install
---
@ -19,8 +19,6 @@ limitations under the License.
-->
{% include JB/setup %}
## Zeppelin Installation
Welcome to your first trial to explore Zeppelin!
@ -42,7 +40,65 @@ You can also build Zeppelin from the source.
If you don't have requirements prepared, please check instructions in [README.md](https://github.com/apache/zeppelin/blob/master/README.md) for the details.
<a name="zeppelin-configuration"> </a>
Maybe you need to configure individual interpreter. If so, please check **Interpreter** section in Zeppelin documentation.
[Spark Interpreter for Apache Zeppelin](../interpreter/spark.html) will be a good example.
## Zeppelin Start / Stop
#### Start Zeppelin
```
bin/zeppelin-daemon.sh start
```
After successful start, visit [http://localhost:8080](http://localhost:8080) with your web browser.
#### Stop Zeppelin
```
bin/zeppelin-daemon.sh stop
```
#### Start Zeppelin with a service manager such as upstart
Zeppelin can auto start as a service with an init script, such as services managed by upstart.
The following is an example upstart script to be saved as `/etc/init/zeppelin.conf`
This example has been tested with Ubuntu Linux.
This also allows the service to be managed with commands such as
`sudo service zeppelin start`
`sudo service zeppelin stop`
`sudo service zeppelin restart`
Other service managers could use a similar approach with the `upstart` argument passed to the zeppelin-daemon.sh script: `bin/zeppelin-daemon.sh upstart`
##### zeppelin.conf
```
description "zeppelin"
start on (local-filesystems and net-device-up IFACE!=lo)
stop on shutdown
# Respawn the process on unexpected termination
respawn
# respawn the job up to 7 times within a 5 second period.
# If the job exceeds these values, it will be stopped and marked as failed.
respawn limit 7 5
# zeppelin was installed in /usr/share/zeppelin in this example
chdir /usr/share/zeppelin
exec bin/zeppelin-daemon.sh upstart
```
#### Running on Windows
```
bin\zeppelin.cmd
```
## Zeppelin Configuration
You can configure Zeppelin with both **environment variables** in `conf/zeppelin-env.sh` (`conf\zeppelin-env.cmd` for Windows) and **Java properties** in `conf/zeppelin-site.xml`. If both are defined, then the **environment variables** will take priority.
@ -250,60 +306,3 @@ You can configure Zeppelin with both **environment variables** in `conf/zeppelin
<td>Size in characters of the maximum text message to be received by websocket.</td>
</tr>
</table>
Maybe you need to configure individual interpreter. If so, please check **Interpreter** section in Zeppelin documentation.
[Spark Interpreter for Apache Zeppelin](../interpreter/spark.html) will be a good example.
## Zeppelin Start / Stop
#### Start Zeppelin
```
bin/zeppelin-daemon.sh start
```
After successful start, visit [http://localhost:8080](http://localhost:8080) with your web browser.
#### Stop Zeppelin
```
bin/zeppelin-daemon.sh stop
```
#### Start Zeppelin with a service manager such as upstart
Zeppelin can auto start as a service with an init script, such as services managed by upstart.
The following is an example upstart script to be saved as `/etc/init/zeppelin.conf`
This example has been tested with Ubuntu Linux.
This also allows the service to be managed with commands such as
`sudo service zeppelin start`
`sudo service zeppelin stop`
`sudo service zeppelin restart`
Other service managers could use a similar approach with the `upstart` argument passed to the zeppelin-daemon.sh script: `bin/zeppelin-daemon.sh upstart`
##### zeppelin.conf
```
description "zeppelin"
start on (local-filesystems and net-device-up IFACE!=lo)
stop on shutdown
# Respawn the process on unexpected termination
respawn
# respawn the job up to 7 times within a 5 second period.
# If the job exceeds these values, it will be stopped and marked as failed.
respawn limit 7 5
# zeppelin was installed in /usr/share/zeppelin in this example
chdir /usr/share/zeppelin
exec bin/zeppelin-daemon.sh upstart
```
#### Running on Windows
```
bin\zeppelin.cmd
```

View file

@ -38,7 +38,7 @@ This script requires three applications, [Ansible](http://docs.ansible.com/ansib
If you are running Windows and don't yet have python installed, [install Python 2.7.x](https://www.python.org/downloads/release/python-2710/) first.
1. Download and Install Vagrant: [Vagrant Downloads](http://www.vagrantup.com/downloads)
1. Download and Install Vagrant: [Vagrant Downloads](http://www.vagrantup.com/downloads.html)
2. Install Ansible: [Ansible Python pip install](http://docs.ansible.com/ansible/intro_installation.html#latest-releases-via-pip)
```

View file

@ -15,7 +15,7 @@ This interpreter lets you create a JDBC connection to any data source, by now it
* MySql
* MariaDB
* Redshift
* Hive
* Apache Hive
* Apache Drill
* Details on using [Drill JDBC Driver](https://drill.apache.org/docs/using-the-jdbc-driver)
* Apache Tajo

View file

@ -34,7 +34,7 @@ To create text input form, use `${formName}` templates.
for example
<img src="../assets/themes/zeppelin/img/screenshots/form_input.png" />
<img class="img-responsive" src="/assets/themes/zeppelin/img/screenshots/form_input.png" width="450px" />
Also you can provide default value, using `${formName=defaultValue}`.

View file

@ -73,7 +73,7 @@ limitations under the License.
"zeppelin.server.context.path": "/",
"zeppelin.ssl.keystore.type": "JKS",
"zeppelin.ssl.truststore.path": "truststore",
"zeppelin.interpreters": "org.apache.zeppelin.spark.SparkInterpreter,org.apache.zeppelin.spark.PySparkInterpreter,org.apache.zeppelin.spark.SparkRInterpreter,org.apache.zeppelin.spark.SparkSqlInterpreter,org.apache.zeppelin.spark.DepInterpreter,org.apache.zeppelin.markdown.Markdown,org.apache.zeppelin.angular.AngularInterpreter,org.apache.zeppelin.shell.ShellInterpreter,org.apache.zeppelin.hive.HiveInterpreter,org.apache.zeppelin.flink.FlinkInterpreter,org.apache.zeppelin.lens.LensInterpreter,org.apache.zeppelin.ignite.IgniteInterpreter,org.apache.zeppelin.ignite.IgniteSqlInterpreter,org.apache.zeppelin.cassandra.CassandraInterpreter,org.apache.zeppelin.geode.GeodeOqlInterpreter,org.apache.zeppelin.postgresql.PostgreSqlInterpreter,org.apache.zeppelin.phoenix.PhoenixInterpreter,org.apache.zeppelin.kylin.KylinInterpreter,org.apache.zeppelin.elasticsearch.ElasticsearchInterpreter,org.apache.zeppelin.scalding.ScaldingInterpreter",
"zeppelin.interpreters": "org.apache.zeppelin.spark.SparkInterpreter,org.apache.zeppelin.spark.PySparkInterpreter,org.apache.zeppelin.spark.SparkRInterpreter,org.apache.zeppelin.spark.SparkSqlInterpreter,org.apache.zeppelin.spark.DepInterpreter,org.apache.zeppelin.markdown.Markdown,org.apache.zeppelin.angular.AngularInterpreter,org.apache.zeppelin.shell.ShellInterpreter,org.apache.zeppelin.flink.FlinkInterpreter,org.apache.zeppelin.lens.LensInterpreter,org.apache.zeppelin.ignite.IgniteInterpreter,org.apache.zeppelin.ignite.IgniteSqlInterpreter,org.apache.zeppelin.cassandra.CassandraInterpreter,org.apache.zeppelin.geode.GeodeOqlInterpreter,org.apache.zeppelin.postgresql.PostgreSqlInterpreter,org.apache.zeppelin.phoenix.PhoenixInterpreter,org.apache.zeppelin.kylin.KylinInterpreter,org.apache.zeppelin.elasticsearch.ElasticsearchInterpreter,org.apache.zeppelin.scalding.ScaldingInterpreter",
"zeppelin.ssl": "false",
"zeppelin.notebook.autoInterpreterBinding": "true",
"zeppelin.notebook.homescreen": "",

View file

@ -125,8 +125,12 @@ public class PythonInterpreter extends Interpreter {
logger.info("closing Python interpreter .....");
try {
process.close();
gatewayServer.shutdown();
if (process != null) {
process.close();
}
if (gatewayServer != null) {
gatewayServer.shutdown();
}
} catch (IOException e) {
logger.error("Can't close the interpreter", e);
}

View file

@ -0,0 +1,43 @@
/*
* 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.
*/
package org.apache.zeppelin.interpreter;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class LazyOpenInterpreterTest {
Interpreter interpreter = mock(Interpreter.class);
@Test
public void isOpenTest() {
InterpreterResult interpreterResult = new InterpreterResult(InterpreterResult.Code.SUCCESS, "");
when(interpreter.interpret(any(String.class), any(InterpreterContext.class))).thenReturn(interpreterResult);
LazyOpenInterpreter lazyOpenInterpreter = new LazyOpenInterpreter(interpreter);
assertFalse("Interpreter is not open", lazyOpenInterpreter.isOpen());
InterpreterContext interpreterContext =
new InterpreterContext("note", "id", "title", "text", null, null, null, null, null, null, null);
lazyOpenInterpreter.interpret("intp 1", interpreterContext);
assertTrue("Interpeter is open", lazyOpenInterpreter.isOpen());
}
}

View file

@ -63,10 +63,15 @@ public class CredentialRestApi {
@PUT
public Response putCredentials(String message) throws IOException {
Map<String, String> messageMap = gson.fromJson(message,
new TypeToken<Map<String, String>>(){}.getType());
new TypeToken<Map<String, String>>(){}.getType());
String entity = messageMap.get("entity");
String username = messageMap.get("username");
String password = messageMap.get("password");
if (entity == null || username == null || password == null) {
return new JsonResponse(Status.BAD_REQUEST, "", "").build();
}
String user = SecurityUtils.getPrincipal();
logger.info("Update credentials for user {} entity {}", user, entity);
UserCredentials uc = credentials.getUserCredentials(user);

View file

@ -686,7 +686,52 @@ public class NotebookRestApi {
}
return new JsonResponse<>(Status.OK, note.getConfig().get("cron")).build();
}
}
/**
* Get notebook jobs for job manager
* @param
* @return JSON with status.OK
* @throws IOException, IllegalArgumentException
*/
@GET
@Path("jobmanager/")
@ZeppelinApi
public Response getJobListforNotebook() throws IOException, IllegalArgumentException {
LOG.info("Get notebook jobs for job manager");
List<Map<String, Object>> notebookJobs = notebook.getJobListforNotebook(false, 0);
Map<String, Object> response = new HashMap<>();
response.put("lastResponseUnixTime", System.currentTimeMillis());
response.put("jobs", notebookJobs);
return new JsonResponse<>(Status.OK, response).build();
}
/**
* Get updated notebook jobs for job manager
* @param
* @return JSON with status.OK
* @throws IOException, IllegalArgumentException
*/
@GET
@Path("jobmanager/{lastUpdateUnixtime}/")
@ZeppelinApi
public Response getUpdatedJobListforNotebook(
@PathParam("lastUpdateUnixtime") long lastUpdateUnixTime) throws
IOException, IllegalArgumentException {
LOG.info("Get updated notebook jobs lastUpdateTime {}", lastUpdateUnixTime);
List<Map<String, Object>> notebookJobs;
notebookJobs = notebook.getJobListforNotebook(false, lastUpdateUnixTime);
Map<String, Object> response = new HashMap<>();
response.put("lastResponseUnixTime", System.currentTimeMillis());
response.put("jobs", notebookJobs);
return new JsonResponse<>(Status.OK, response).build();
}
/**
* Search for a Notes with permissions

View file

@ -63,6 +63,20 @@ import org.slf4j.LoggerFactory;
public class NotebookServer extends WebSocketServlet implements
NotebookSocketListener, JobListenerFactory, AngularObjectRegistryListener,
RemoteInterpreterProcessListener, ApplicationEventListener {
/**
* Job manager service type
*/
protected enum JOB_MANAGER_SERVICE {
JOB_MANAGER_PAGE("JOB_MANAGER_PAGE");
private String serviceTypeKey;
JOB_MANAGER_SERVICE(String serviceType) {
this.serviceTypeKey = serviceType;
}
String getKey() {
return this.serviceTypeKey;
}
}
private static final Logger LOG = LoggerFactory.getLogger(NotebookServer.class);
Gson gson = new GsonBuilder()
.setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").create();
@ -205,6 +219,12 @@ public class NotebookServer extends WebSocketServlet implements
case CHECKPOINT_NOTEBOOK:
checkpointNotebook(conn, notebook, messagereceived);
break;
case LIST_NOTEBOOK_JOBS:
unicastNotebookJobInfo(conn);
break;
case LIST_UPDATE_NOTEBOOK_JOBS:
unicastUpdateNotebookJobInfo(conn, messagereceived);
break;
default:
break;
}
@ -352,6 +372,34 @@ public class NotebookServer extends WebSocketServlet implements
}
}
public void unicastNotebookJobInfo(NotebookSocket conn) throws IOException {
List<Map<String, Object>> notebookJobs = notebook().getJobListforNotebook(false, 0);
Map<String, Object> response = new HashMap<>();
response.put("lastResponseUnixTime", System.currentTimeMillis());
response.put("jobs", notebookJobs);
conn.send(serializeMessage(new Message(OP.LIST_NOTEBOOK_JOBS)
.put("notebookJobs", response)));
}
public void unicastUpdateNotebookJobInfo(NotebookSocket conn, Message fromMessage)
throws IOException {
double lastUpdateUnixTimeRaw = (double) fromMessage.get("lastUpdateUnixTime");
long lastUpdateUnixTime = new Double(lastUpdateUnixTimeRaw).longValue();
List<Map<String, Object>> notebookJobs;
notebookJobs = notebook().getJobListforNotebook(false, lastUpdateUnixTime);
Map<String, Object> response = new HashMap<>();
response.put("lastResponseUnixTime", System.currentTimeMillis());
response.put("jobs", notebookJobs);
conn.send(serializeMessage(new Message(OP.LIST_UPDATE_NOTEBOOK_JOBS)
.put("notebookRunningJobs", response)));
}
public List<Map<String, String>> generateNotebooksInfo(boolean needsReload) {
Notebook notebook = notebook();

View file

@ -0,0 +1,76 @@
/*
* 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.
*/
package org.apache.zeppelin.rest;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PutMethod;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.IOException;
import java.util.Map;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
public class CredentialsRestApiTest extends AbstractTestRestApi {
Gson gson = new Gson();
@BeforeClass
public static void init() throws Exception {
AbstractTestRestApi.startUp();
}
@AfterClass
public static void destroy() throws Exception {
AbstractTestRestApi.shutDown();
}
@Test
public void testInvalidRequest() throws IOException {
String jsonInvalidRequestEntityNull = "{\"entity\" : null, \"username\" : \"test\", \"password\" : \"testpass\"}";
String jsonInvalidRequestNameNull = "{\"entity\" : \"test\", \"username\" : null, \"password\" : \"testpass\"}";
String jsonInvalidRequestPasswordNull = "{\"entity\" : \"test\", \"username\" : \"test\", \"password\" : null}";
String jsonInvalidRequestAllNull = "{\"entity\" : null, \"username\" : null, \"password\" : null}";
PutMethod entityNullPut = httpPut("/credential", jsonInvalidRequestEntityNull);
entityNullPut.addRequestHeader("Origin", "http://localhost");
assertThat(entityNullPut, isBadRequest());
entityNullPut.releaseConnection();
PutMethod nameNullPut = httpPut("/credential", jsonInvalidRequestNameNull);
nameNullPut.addRequestHeader("Origin", "http://localhost");
assertThat(nameNullPut, isBadRequest());
nameNullPut.releaseConnection();
PutMethod passwordNullPut = httpPut("/credential", jsonInvalidRequestPasswordNull);
passwordNullPut.addRequestHeader("Origin", "http://localhost");
assertThat(passwordNullPut, isBadRequest());
passwordNullPut.releaseConnection();
PutMethod allNullPut = httpPut("/credential", jsonInvalidRequestAllNull);
allNullPut.addRequestHeader("Origin", "http://localhost");
assertThat(allNullPut, isBadRequest());
allNullPut.releaseConnection();
}
}

View file

@ -18,6 +18,10 @@ angular.module('zeppelinWebApp').controller('CredentialCtrl', function($scope, $
$http, baseUrlSrv) {
$scope._ = _;
$scope.credentialEntity = '';
$scope.credentialUsername = '';
$scope.credentialPassword = '';
$scope.updateCredentials = function() {
$http.put(baseUrlSrv.getRestApiBase() + '/credential',
{ 'entity': $scope.credentialEntity,

View file

@ -54,10 +54,10 @@ limitations under the License.
</a>
</li>
<li>
<a ng-click="moveUp()"><span class="icon-arrow-up"></span> Move Up</a>
<a ng-click="moveUp()" ng-hide="$first"><span class="icon-arrow-up"></span> Move Up</a>
</li>
<li>
<a ng-click="moveDown()"><span class="icon-arrow-down"></span> Move Down</a>
<a ng-click="moveDown()" ng-hide="$last"><span class="icon-arrow-down"></span> Move Down</a>
</li>
<li>
<a ng-click="insertNew()"><span class="icon-plus"></span> Insert New</a>
@ -87,7 +87,7 @@ limitations under the License.
</li>
<li>
<!-- remove paragraph -->
<a ng-click="removeParagraph()"><span class="fa fa-times"></span> Remove</a>
<a ng-click="removeParagraph()" ng-hide="$last"><span class="fa fa-times"></span> Remove</a>
</li>
</ul>
</span>

View file

@ -578,17 +578,25 @@ angular.module('zeppelinWebApp')
};
$scope.removeParagraph = function() {
BootstrapDialog.confirm({
closable: true,
title: '',
message: 'Do you want to delete this paragraph?',
callback: function(result) {
if (result) {
console.log('Remove paragraph');
websocketMsgSrv.removeParagraph($scope.paragraph.id);
var paragraphs = angular.element('div[id$="_paragraphColumn_main"');
if (paragraphs[paragraphs.length-1].id.startsWith($scope.paragraph.id)) {
BootstrapDialog.alert({
closable: true,
message: 'The last paragraph can\'t be deleted.'
});
} else {
BootstrapDialog.confirm({
closable: true,
title: '',
message: 'Do you want to delete this paragraph?',
callback: function(result) {
if (result) {
console.log('Remove paragraph');
websocketMsgSrv.removeParagraph($scope.paragraph.id);
}
}
}
});
});
}
};
$scope.clearParagraphOutput = function() {

View file

@ -18,6 +18,8 @@ angular
.module('zeppelinWebApp')
.controller('SearchResultCtrl', function($scope, $routeParams, searchService) {
$scope.isResult = true ;
$scope.searchTerm = $routeParams.searchTerm;
var results = searchService.search({'q': $routeParams.searchTerm}).query();
results.$promise.then(function(result) {
@ -34,6 +36,17 @@ angular
return note;
});
if ($scope.notes.length === 0) {
$scope.isResult = false;
} else {
$scope.isResult = true;
}
$scope.$on('$routeChangeStart', function (event, next, current) {
if (next.originalPath !== '/search/:searchTerm') {
searchService.searchTerm = '';
}
});
});
$scope.page = 0;

View file

@ -11,8 +11,8 @@ 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 ng-controller="SearchResultCtrl" class="searchResults">
<div class="row">
<div class="searchResults">
<div ng-if="isResult" class="row">
<div class="col-sm-8" style="margin: 0 auto; float: none">
<ul class="search-results">
<li class="panel panel-default" ng-repeat="note in notes">
@ -37,6 +37,10 @@ limitations under the License.
</div>
</div>
</li>
</ul>
</div>
</div>
<div ng-if="!isResult" class="search-no-result-found">
<span class="glyphicon glyphicon-search"></span> We couldnt find any notebook matching <b>'{{searchTerm}}' </b>
</div>
</div>

View file

@ -40,3 +40,12 @@
.search-results .ace_invalid {
background: none !important;
}
.search-no-result-found {
border: 1px solid;
margin: 150px 150px;
padding: 15px 10px 15px 0px;
color: #00529B;
text-align: center;
background-color: #f4f6f8;
}

View file

@ -53,7 +53,8 @@ angular.module('zeppelinWebApp')
};
})
.controller('NavCtrl', function($scope, $rootScope, $http, $routeParams,
$location, notebookListDataFactory, baseUrlSrv, websocketMsgSrv, arrayOrderingSrv) {
$location, notebookListDataFactory, baseUrlSrv, websocketMsgSrv, arrayOrderingSrv, searchService) {
/** Current list of notes (ids) */
$scope.showLoginWindow = function() {
@ -62,11 +63,14 @@ angular.module('zeppelinWebApp')
}, 500);
};
var vm = this;
vm.notes = notebookListDataFactory;
vm.connected = websocketMsgSrv.isConnected();
vm.websocketMsgSrv = websocketMsgSrv;
vm.arrayOrderingSrv = arrayOrderingSrv;
$scope.searchForm = searchService;
if ($rootScope.ticket) {
$rootScope.fullUsername = $rootScope.ticket.principal;
$rootScope.truncatedUsername = $rootScope.ticket.principal;

View file

@ -63,15 +63,17 @@ limitations under the License.
<ul class="nav navbar-nav navbar-right" style="margin-right:5px;">
<li ng-if="ticket" style="margin-top:10px;">
<!--TODO(bzz): move to Typeahead https://angular-ui.github.io/bootstrap -->
<form role="search"
<form role="search" data-ng-model="searchForm"
style="display: inline-block; margin: 0px"
class="navbar-form"
ng-submit="search(searchTerm)">
ng-submit="search(searchForm.searchTerm)">
<div class="input-group">
<input
type="text"
style="min-width:300px;"
ng-model="searchTerm"
ng-model="searchForm.searchTerm"
id="searchTermId"
ng-disabled="!navbar.connected"
class="form-control"
placeholder="Search your Notebooks"
@ -80,7 +82,7 @@ limitations under the License.
<button
type="submit"
class="btn btn-default"
ng-disabled="!navbar.connected"
ng-disabled="!navbar.connected || !searchForm.searchTerm"
>
<i class="glyphicon glyphicon-search"></i>
</button>

View file

@ -16,6 +16,7 @@
angular.module('zeppelinWebApp').service('searchService', function($resource, baseUrlSrv) {
this.search = function(term) {
this.searchTerm = term.q;
console.log('Searching for: %o', term.q);
if (!term.q) { //TODO(bzz): empty string check
return;
@ -26,4 +27,6 @@ angular.module('zeppelinWebApp').service('searchService', function($resource, ba
});
};
this.searchTerm = '';
});

View file

@ -495,7 +495,6 @@ public class ZeppelinConfiguration extends XMLConfiguration {
+ "org.apache.zeppelin.livy.LivySparkSQLInterpreter,"
+ "org.apache.zeppelin.livy.LivyPySparkInterpreter,"
+ "org.apache.zeppelin.livy.LivySparkRInterpreter,"
+ "org.apache.zeppelin.hive.HiveInterpreter,"
+ "org.apache.zeppelin.alluxio.AlluxioInterpreter,"
+ "org.apache.zeppelin.file.HDFSFileInterpreter,"
+ "org.apache.zeppelin.phoenix.PhoenixInterpreter,"

View file

@ -528,6 +528,138 @@ public class Notebook implements NoteEventListener {
this.jobListenerFactory = jobListenerFactory;
}
private Map<String, Object> getParagraphForJobManagerItem(Paragraph paragraph) {
Map<String, Object> paragraphItem = new HashMap<>();
// set paragraph id
paragraphItem.put("id", paragraph.getId());
// set paragraph name
String paragraphName = paragraph.getTitle();
if (paragraphName != null) {
paragraphItem.put("name", paragraphName);
} else {
paragraphItem.put("name", paragraph.getId());
}
// set status for paragraph.
paragraphItem.put("status", paragraph.getStatus().toString());
return paragraphItem;
}
private long getUnixTimeLastRunParagraph(Paragraph paragraph) {
Date lastRunningDate = null;
long lastRunningUnixTime = 0;
Date paragaraphDate = paragraph.getDateStarted();
// diff started time <-> finishied time
if (paragaraphDate == null) {
paragaraphDate = paragraph.getDateFinished();
} else {
if (paragraph.getDateFinished() != null &&
paragraph.getDateFinished().after(paragaraphDate)) {
paragaraphDate = paragraph.getDateFinished();
}
}
// finished time and started time is not exists.
if (paragaraphDate == null) {
paragaraphDate = paragraph.getDateCreated();
}
// set last update unixtime(ms).
lastRunningDate = paragaraphDate;
lastRunningUnixTime = lastRunningDate.getTime();
return lastRunningUnixTime;
}
public List<Map<String, Object>> getJobListforNotebook(boolean needsReload,
long lastUpdateServerUnixTime) {
final String CRON_TYPE_NOTEBOOK_KEYWORD = "cron";
if (needsReload) {
try {
reloadAllNotes();
} catch (IOException e) {
logger.error("Fail to reload notes from repository");
}
}
List<Note> notes = getAllNotes();
List<Map<String, Object>> notesInfo = new LinkedList<>();
for (Note note : notes) {
boolean isNotebookRunning = false;
boolean isUpdateNotebook = false;
long lastRunningUnixTime = 0;
Map<String, Object> info = new HashMap<>();
// set notebook ID
info.put("notebookId", note.id());
// set notebook Name
String notebookName = note.getName();
if (notebookName != null) {
info.put("notebookName", note.getName());
} else {
info.put("notebookName", "Note " + note.id());
}
// set notebook type ( cron or normal )
if (note.getConfig().containsKey(CRON_TYPE_NOTEBOOK_KEYWORD) == true &&
!note.getConfig().get(CRON_TYPE_NOTEBOOK_KEYWORD).equals("")) {
info.put("notebookType", "cron");
}
else {
info.put("notebookType", "normal");
}
// set paragraphs
List<Map<String, Object>> paragraphsInfo = new LinkedList<>();
for (Paragraph paragraph : note.getParagraphs()) {
// check paragraph's status.
if (paragraph.getStatus().isRunning() == true) {
isNotebookRunning = true;
isUpdateNotebook = true;
}
// get data for the job manager.
Map<String, Object> paragraphItem = getParagraphForJobManagerItem(paragraph);
lastRunningUnixTime = getUnixTimeLastRunParagraph(paragraph);
// is update notebook for last server update time.
if (lastRunningUnixTime > lastUpdateServerUnixTime) {
paragraphsInfo.add(paragraphItem);
isUpdateNotebook = true;
}
}
// set interpreter bind type
String interpreterGroupName = null;
if (note.getNoteReplLoader().getInterpreterSettings() != null &&
note.getNoteReplLoader().getInterpreterSettings().size() >= 1) {
interpreterGroupName = note.getNoteReplLoader().getInterpreterSettings().get(0).getGroup();
}
// not update and not running -> pass
if (isUpdateNotebook == false && isNotebookRunning == false) {
continue;
}
// notebook json object root information.
info.put("interpreter", interpreterGroupName);
info.put("isRunningJob", isNotebookRunning);
info.put("unixTimeLastRun", lastRunningUnixTime);
info.put("paragraphs", paragraphsInfo);
notesInfo.add(info);
}
return notesInfo;
}
/**
* Cron task for the note.
*/

View file

@ -119,6 +119,10 @@ public class Message {
APP_UPDATE_OUTPUT, // [s-c] update (replace) output
APP_LOAD, // [s-c] on app load
APP_STATUS_CHANGE // [s-c] on app status change
LIST_NOTEBOOK_JOBS, // [c-s] get notebook job management infomations
LIST_UPDATE_NOTEBOOK_JOBS // [c-s] get job management informations for until unixtime
// @param unixTime
}
public OP op;

View file

@ -17,11 +17,6 @@
package org.apache.zeppelin.interpreter;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.io.*;
import java.util.LinkedList;
import java.util.List;
@ -40,6 +35,8 @@ import org.junit.Before;
import org.junit.Test;
import org.sonatype.aether.RepositoryException;
import static org.junit.Assert.*;
public class InterpreterFactoryTest {
private InterpreterFactory factory;
@ -79,10 +76,7 @@ public class InterpreterFactoryTest {
factory.createInterpretersForNote(setting, "sharedProcess", "session");
// get interpreter
Interpreter repl1 = interpreterGroup.get("session").get(0);
assertFalse(((LazyOpenInterpreter) repl1).isOpen());
repl1.interpret("repl1", context);
assertTrue(((LazyOpenInterpreter) repl1).isOpen());
assertNotNull("get Interpreter", interpreterGroup.get("session").get(0));
// try to get unavailable interpreter
assertNull(factory.get("unknown"));