diff --git a/.travis.yml b/.travis.yml index 5d4fc6a30eb..1da8ea3a05a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -84,7 +84,7 @@ before_install: - source ~/.environ install: - - mvn $BUILD_FLAG $PROFILE -B + - mvn -Dorg.slf4j.simpleLogger.defaultLogLevel=warn $BUILD_FLAG $PROFILE -B before_script: - travis_retry ./testing/downloadSpark.sh $SPARK_VER $HADOOP_VER diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterEventPoller.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterEventPoller.java index bf64d9fa084..5c67cbf2d5d 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterEventPoller.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterEventPoller.java @@ -27,6 +27,7 @@ import org.apache.zeppelin.interpreter.InterpreterGroup; import org.apache.zeppelin.interpreter.InterpreterResult; import org.apache.zeppelin.interpreter.RemoteZeppelinServerResource; +import org.apache.zeppelin.interpreter.InterpreterOption; import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEvent; import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterEventType; import org.apache.zeppelin.interpreter.thrift.RemoteInterpreterService.Client; @@ -235,10 +236,10 @@ public void run() { Map metaInfos = gson.fromJson(event.getData(), new TypeToken>() { }.getType()); - String id = interpreterGroup.getId(); - int indexOfColon = id.indexOf(":"); - String settingId = id.substring(0, indexOfColon); - listener.onMetaInfosReceived(settingId, metaInfos); + String intpGroupId = interpreterGroup.getId(); + int indexOfColon = intpGroupId.indexOf(":"); + String settingId = intpGroupId.substring(0, indexOfColon); + listener.onMetaInfosReceived(settingId, intpGroupId, metaInfos); } logger.debug("Event from remote process {}", event.getType()); } catch (Exception e) { diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcessListener.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcessListener.java index 66b08c95a1d..547bc3a1f1d 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcessListener.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcessListener.java @@ -28,7 +28,8 @@ public interface RemoteInterpreterProcessListener { public void onOutputUpdated( String noteId, String paragraphId, int index, InterpreterResult.Type type, String output); public void onOutputClear(String noteId, String paragraphId); - public void onMetaInfosReceived(String settingId, Map metaInfos); + public void onMetaInfosReceived(String settingId, String intpGrpId, + Map metaInfos); public void onRemoteRunParagraph(String noteId, String ParagraphID) throws Exception; public void onGetParagraphRunners( String noteId, String paragraphId, RemoteWorksEventListener callback); diff --git a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterOutputTestStream.java b/zeppelin-interpreter/src/test/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterOutputTestStream.java index 0ac11c2584d..c4056280d03 100644 --- a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterOutputTestStream.java +++ b/zeppelin-interpreter/src/test/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterOutputTestStream.java @@ -168,7 +168,8 @@ public void onOutputClear(String noteId, String paragraphId) { } @Override - public void onMetaInfosReceived(String settingId, Map metaInfos) { + public void onMetaInfosReceived(String settingId, String intpGrpId, + Map metaInfos) { } diff --git a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/scheduler/RemoteSchedulerTest.java b/zeppelin-interpreter/src/test/java/org/apache/zeppelin/scheduler/RemoteSchedulerTest.java index c450891ecc7..c05cf7a8abd 100644 --- a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/scheduler/RemoteSchedulerTest.java +++ b/zeppelin-interpreter/src/test/java/org/apache/zeppelin/scheduler/RemoteSchedulerTest.java @@ -310,7 +310,8 @@ public void onOutputClear(String noteId, String paragraphId) { } @Override - public void onMetaInfosReceived(String settingId, Map metaInfos) { + public void onMetaInfosReceived(String settingId, String intpGrpId, + Map metaInfos) { } diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/InterpreterRestApi.java b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/InterpreterRestApi.java index 90a58ac0d62..26f80b2a110 100644 --- a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/InterpreterRestApi.java +++ b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/InterpreterRestApi.java @@ -23,7 +23,6 @@ import java.util.Map; import java.util.Properties; -import javax.servlet.http.HttpServletRequest; import javax.ws.rs.DELETE; import javax.ws.rs.GET; import javax.ws.rs.POST; @@ -31,7 +30,7 @@ import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; +import javax.ws.rs.QueryParam; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; @@ -47,6 +46,7 @@ import org.apache.zeppelin.interpreter.InterpreterException; import org.apache.zeppelin.interpreter.InterpreterFactory; import org.apache.zeppelin.interpreter.InterpreterSetting; +import org.apache.zeppelin.rest.message.MetaInfosInterpreterRequest; import org.apache.zeppelin.rest.message.NewInterpreterSettingRequest; import org.apache.zeppelin.rest.message.UpdateInterpreterSettingRequest; import org.apache.zeppelin.server.JsonResponse; @@ -245,15 +245,16 @@ public Response addRepository(String message) { */ @GET @Path("getmetainfos/{settingId}") - public Response getMetaInfo(@Context HttpServletRequest req, - @PathParam("settingId") String settingId) { - String propName = req.getParameter("propName"); + public Response getMetaInfo(String message, + @PathParam("settingId") String settingId, @QueryParam("noteId") String noteId, + @QueryParam("subject")String subject, @QueryParam("property") String propName) { + if (propName == null) { return new JsonResponse<>(Status.BAD_REQUEST).build(); } String propValue = null; InterpreterSetting interpreterSetting = interpreterFactory.get(settingId); - Map infos = interpreterSetting.getInfos(); + Map infos = interpreterSetting.getInfos(subject, noteId); if (infos != null) { propValue = infos.get(propName); } diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/message/MetaInfosInterpreterRequest.java b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/message/MetaInfosInterpreterRequest.java new file mode 100644 index 00000000000..96451e1ebe8 --- /dev/null +++ b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/message/MetaInfosInterpreterRequest.java @@ -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.rest.message; + +/** + * Meta infos rest api request message + */ +public class MetaInfosInterpreterRequest { + String noteId; + String subject; + String property; + + public MetaInfosInterpreterRequest() { + + } + + public String getNoteId() { + return noteId; + } + + public String getSubject() { + return subject; + } + + public String getProperty() { + return property; + } +} diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java b/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java index 8764accd515..1a299d495bf 100644 --- a/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java +++ b/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java @@ -1931,10 +1931,11 @@ private void getInterpreterSettings(NotebookSocket conn, AuthenticationInfo subj } @Override - public void onMetaInfosReceived(String settingId, Map metaInfos) { + public void onMetaInfosReceived(String settingId, String intpGrpId, + Map metaInfos) { InterpreterSetting interpreterSetting = notebook().getInterpreterFactory() .get(settingId); - interpreterSetting.setInfos(metaInfos); + interpreterSetting.setInfos(intpGrpId, metaInfos); } private void switchConnectionToWatcher(NotebookSocket conn, Message messagereceived) diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/types/InterpreterSettingsList.java b/zeppelin-server/src/main/java/org/apache/zeppelin/types/InterpreterSettingsList.java index e0169167619..bc7b5721bfc 100644 --- a/zeppelin-server/src/main/java/org/apache/zeppelin/types/InterpreterSettingsList.java +++ b/zeppelin-server/src/main/java/org/apache/zeppelin/types/InterpreterSettingsList.java @@ -29,12 +29,14 @@ public class InterpreterSettingsList { private String name; private boolean selected; private List interpreters; + private String group; public InterpreterSettingsList(String id, String name, - List interpreters, boolean selected) { + List interpreters, boolean selected, String group) { this.id = id; this.name = name; this.interpreters = interpreters; this.selected = selected; + this.group = group; } } diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/utils/InterpreterBindingUtils.java b/zeppelin-server/src/main/java/org/apache/zeppelin/utils/InterpreterBindingUtils.java index 9333afd9ef8..8a59a5f1c25 100644 --- a/zeppelin-server/src/main/java/org/apache/zeppelin/utils/InterpreterBindingUtils.java +++ b/zeppelin-server/src/main/java/org/apache/zeppelin/utils/InterpreterBindingUtils.java @@ -34,7 +34,7 @@ public static List getInterpreterBindings(Notebook note notebook.getBindedInterpreterSettings(noteId); for (InterpreterSetting setting : selectedSettings) { settingList.add(new InterpreterSettingsList(setting.getId(), setting.getName(), - setting.getInterpreterInfos(), true)); + setting.getInterpreterInfos(), true, setting.getGroup())); } List availableSettings = notebook.getInterpreterFactory().get(); @@ -49,7 +49,7 @@ public static List getInterpreterBindings(Notebook note if (!selected) { settingList.add(new InterpreterSettingsList(setting.getId(), setting.getName(), - setting.getInterpreterInfos(), false)); + setting.getInterpreterInfos(), false, setting.getGroup())); } } diff --git a/zeppelin-web/package.json b/zeppelin-web/package.json index aa81567ab01..61442c04aa0 100644 --- a/zeppelin-web/package.json +++ b/zeppelin-web/package.json @@ -7,8 +7,7 @@ "postinstall": "node_modules/.bin/bower install --silent", "build": "./node_modules/.bin/grunt build", "start": "./node_modules/.bin/grunt serve", - "test": "./node_modules/.bin/grunt test", - "pretest": "./node_modules/.bin/npm install karma-phantomjs-launcher" + "test": "./node_modules/.bin/grunt test" }, "dependencies": { "grunt-angular-templates": "^0.5.7", @@ -48,6 +47,7 @@ "karma": "~1.3.0", "karma-coverage": "^1.1.1", "karma-jasmine": "~1.0.2", + "karma-phantomjs-launcher": "~1.0.2", "load-grunt-tasks": "^0.4.0", "time-grunt": "^0.3.1" }, diff --git a/zeppelin-web/pom.xml b/zeppelin-web/pom.xml index bf52e3cd1c0..1caa722a988 100644 --- a/zeppelin-web/pom.xml +++ b/zeppelin-web/pom.xml @@ -108,8 +108,8 @@ install-node-and-npm - ${node.version} - ${npm.version} + v6.9.1 + 3.10.8 diff --git a/zeppelin-web/src/app/interpreter/interpreter.controller.js b/zeppelin-web/src/app/interpreter/interpreter.controller.js index ed5a45c9c5e..59c281dd70f 100644 --- a/zeppelin-web/src/app/interpreter/interpreter.controller.js +++ b/zeppelin-web/src/app/interpreter/interpreter.controller.js @@ -700,7 +700,12 @@ }; $scope.showSparkUI = function(settingId) { - $http.get(baseUrlSrv.getRestApiBase() + '/interpreter/getmetainfos/' + settingId + '?propName=url') + var userName; + if ($rootScope.ticket) { + userName = $rootScope.ticket.principal; + } + $http.get(baseUrlSrv.getRestApiBase() + '/interpreter/getmetainfos/' + settingId + '?subject=' + + userName + '&property=url') .success(function(data, status, headers, config) { var url = data.body.url; if (!url) { diff --git a/zeppelin-web/src/app/interpreter/interpreter.html b/zeppelin-web/src/app/interpreter/interpreter.html index a33127fa4a8..634d7cd2dd6 100644 --- a/zeppelin-web/src/app/interpreter/interpreter.html +++ b/zeppelin-web/src/app/interpreter/interpreter.html @@ -130,7 +130,8 @@

{{setting.name}}