You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by ah...@apache.org on 2016/11/24 09:02:01 UTC

zeppelin git commit: [ZEPPELIN-917] Apply new mechanism to LensInterpreter

Repository: zeppelin
Updated Branches:
  refs/heads/master abe03a866 -> 0729d12b9


[ZEPPELIN-917] Apply new mechanism to LensInterpreter

### What is this PR for?

This handles replacing the registration of interpreter with static block by the interpreter-setting.json file
### What type of PR is it?

[| Improvement |
### Todos

Sub-Task
### What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-917
### How should this be tested?

here shouldn't be any warning like below on starting the server
INFO [2016-09-29 00:25:46,247]({main} LensInterpreter.java[<clinit>]:155) - Bootstrapping Cassandra Interpreter WARN [2016-09-29 00:25:46,250]({main} Interpreter.java[register]:347) - Static initialization is deprecated for interpreter lens, You should change it to use interpreter-setting.json in your jar or interpreter/{interpreter}/interpreter-setting.json INFO [2016-09-29 00:25:46,250]({main} InterpreterFactory.java[init]:204) - Inclass=org.apache.zeppelin.lens.LensInterpreter

And ensure that the lens related paragraphs run without any error
### Screenshots (if appropriate)
### Questions:
- Does the licenses files need update? No
- Is there breaking changes for older versions? No
- Does this needs documentation? No

Author: meenakshisekar <me...@imaginea.com>

Closes #1548 from meenakshisekar/ZEPPELIN-917 and squashes the following commits:

269e8cb [meenakshisekar] Removed the tabs and added space.
cc8bdc2 [meenakshisekar] Added the indentation similar to other interpreter setting file.
2cba9e7 [meenakshisekar] Added the indentation similar to other interpreter setting file.
ad3b83c [meenakshisekar] Added indentation
f94c8a3 [meenakshisekar] Commented the properties in interpreter file and added setting file.
db2827f [meenakshisekar] Commented the properties in interpreter file and added setting file.


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/0729d12b
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/0729d12b
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/0729d12b

Branch: refs/heads/master
Commit: 0729d12b96918a7ae1ed36d3932416bee26c4301
Parents: abe03a8
Author: meenakshisekar <me...@imaginea.com>
Authored: Thu Oct 27 13:32:10 2016 +0530
Committer: ahyoungryu <ah...@apache.org>
Committed: Thu Nov 24 18:01:54 2016 +0900

----------------------------------------------------------------------
 .../apache/zeppelin/lens/LensInterpreter.java   | 16 +-----
 .../src/main/resources/interpreter-setting.json | 51 ++++++++++++++++++++
 2 files changed, 52 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0729d12b/lens/src/main/java/org/apache/zeppelin/lens/LensInterpreter.java
----------------------------------------------------------------------
diff --git a/lens/src/main/java/org/apache/zeppelin/lens/LensInterpreter.java b/lens/src/main/java/org/apache/zeppelin/lens/LensInterpreter.java
index f0c9062..17e3a46 100644
--- a/lens/src/main/java/org/apache/zeppelin/lens/LensInterpreter.java
+++ b/lens/src/main/java/org/apache/zeppelin/lens/LensInterpreter.java
@@ -88,21 +88,7 @@ public class LensInterpreter extends Interpreter {
   private LensClient m_lensClient;
   
 
-  static {
-    Interpreter.register(
-      "lens",
-      "lens",
-      LensInterpreter.class.getName(),
-      new InterpreterPropertyBuilder()
-        .add(ZEPPELIN_LENS_RUN_CONCURRENT_SESSION, "true", "Run concurrent Lens Sessions")
-        .add(ZEPPELIN_LENS_CONCURRENT_SESSIONS, "10", 
-          "If concurrency is true then how many threads?")
-        .add(ZEPPELIN_MAX_ROWS, "1000", "max number of rows to display")
-        .add(LENS_SERVER_URL, "http://<hostname>:<port>/lensapi", "The URL for Lens Server")
-        .add(LENS_CLIENT_DBNAME, "default", "The database schema name")
-        .add(LENS_PERSIST_RESULTSET, "false", "Apache Lens to persist result in HDFS?")
-        .add(LENS_SESSION_CLUSTER_USER, "default", "Hadoop cluster username").build());
-  }
+
 
   public LensInterpreter(Properties property) {
     super(property);

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0729d12b/lens/src/main/resources/interpreter-setting.json
----------------------------------------------------------------------
diff --git a/lens/src/main/resources/interpreter-setting.json b/lens/src/main/resources/interpreter-setting.json
new file mode 100644
index 0000000..427b01f
--- /dev/null
+++ b/lens/src/main/resources/interpreter-setting.json
@@ -0,0 +1,51 @@
+[
+  {
+    "group": "lens",
+    "name": "lens",
+    "className": "org.apache.zeppelin.lens.LensInterpreter",
+    "properties": {
+      "zeppelin.lens.run.concurrent": {
+        "envName": null,
+        "propertyName": "zeppelin.lens.run.concurrent",
+        "defaultValue": "true",
+        "description": "Run concurrent Lens Sessions"
+      },
+      "zeppelin.lens.maxThreads": {
+        "envName": null,
+        "propertyName": "zeppelin.lens.maxThreads",
+        "defaultValue": "10",
+        "description": "If concurrency is true then how many threads?"
+      },
+      "zeppelin.lens.maxResults": {
+        "envName": null,
+        "propertyName": "zeppelin.lens.maxResults",
+        "defaultValue": "1000",
+        "description": "max number of rows to display"
+      },
+      "lens.server.base.url": {
+        "envName": null,
+        "propertyName": "lens.server.base.url",
+        "defaultValue": "http://<hostname>:<port>/lensapi",
+        "description": "The URL for Lens Server"
+      },
+      "lens.client.dbname": {
+        "envName": null,
+        "propertyName": "lens.client.dbname",
+        "defaultValue": "default",
+        "description": "The database schema name"
+      },
+      "lens.query.enable.persistent.resultset": {
+        "envName": null,
+        "propertyName": "lens.query.enable.persistent.resultset",
+        "defaultValue": "false",
+        "description": "Apache Lens to persist result in HDFS?"
+      },
+      "lens.session.cluster.user": {
+        "envName": null,
+        "propertyName": "lens.session.cluster.user",
+        "defaultValue": "default",
+        "description": "Hadoop cluster username"
+      }
+    }
+  }
+]