zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prabhjyotsi...@apache.org
Subject zeppelin git commit: ZEPPELIN-2555: Run all paragraphs API does not run all paragraph as front-end user.
Date Mon, 22 May 2017 06:45:03 GMT
Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.7 c9b0db772 -> 3bad8ef61


ZEPPELIN-2555: Run all paragraphs API does not run all paragraph as front-end user.

### What is this PR for?
Run all paragraphs API (http://zeppelin.apache.org/docs/0.8.0-SNAPSHOT/rest-api/rest-notebook.html#run-all-paragraphs)
does not run all paragraph as front-end user.

### What type of PR is it?
[Bug Fix]

### Todos
* [ ] - Task

### What is the Jira issue?
* [ZEPPELIN-2555](https://issues.apache.org/jira/browse/ZEPPELIN-2555)

### How should this be tested?
Testing steps in screenshot

### Screenshots (if appropriate)
Before:
![zeppelin-2555-before](https://cloud.githubusercontent.com/assets/674497/26120584/d9990846-3a8e-11e7-897b-754e2075ddc6.gif)

After:
![zeppelin-2555-after](https://cloud.githubusercontent.com/assets/674497/26120391/38ba4b2e-3a8e-11e7-9a0c-c214dbc416e4.gif)

### Questions:
* Does the licenses files need update? N/A
* Is there breaking changes for older versions? N/A
* Does this needs documentation? N/A

Author: Prabhjyot Singh <prabhjyotsingh@gmail.com>

Closes #2348 from prabhjyotsingh/ZEPPELIN-2555 and squashes the following commits:

13350c2f9 [Prabhjyot Singh] add runAll(AuthenticationInfo authenticationInfo) methond

(cherry picked from commit f12bc26bb7dc2011181350cf6ac39fc5f316e949)
Signed-off-by: Prabhjyot Singh <prabhjyotsingh@gmail.com>


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

Branch: refs/heads/branch-0.7
Commit: 3bad8ef610f5fab8ee40b78d260706238c1c1856
Parents: c9b0db7
Author: Prabhjyot Singh <prabhjyotsingh@gmail.com>
Authored: Tue May 16 23:18:56 2017 +0530
Committer: Prabhjyot Singh <prabhjyotsingh@gmail.com>
Committed: Mon May 22 12:14:57 2017 +0530

----------------------------------------------------------------------
 .../main/java/org/apache/zeppelin/rest/NotebookRestApi.java  | 4 ++--
 .../src/main/java/org/apache/zeppelin/notebook/Note.java     | 8 ++++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/3bad8ef6/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java
index 7b02207..b9295ae 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java
@@ -603,17 +603,17 @@ public class NotebookRestApi {
       throws IOException, IllegalArgumentException {
     LOG.info("run note jobs {} ", noteId);
     Note note = notebook.getNote(noteId);
+    AuthenticationInfo subject = new AuthenticationInfo(SecurityUtils.getPrincipal());
     checkIfNoteIsNotNull(note);
     checkIfUserCanWrite(noteId, "Insufficient privileges you cannot run job for this note");
 
     try {
-      note.runAll();
+      note.runAll(subject);
     } catch (Exception ex) {
       LOG.error("Exception from run", ex);
       return new JsonResponse<>(Status.PRECONDITION_FAILED,
           ex.getMessage() + "- Not selected or Invalid Interpreter bind").build();
     }
-
     return new JsonResponse<>(Status.OK).build();
   }
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/3bad8ef6/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Note.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Note.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Note.java
index fbac2e3..1964a08 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Note.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Note.java
@@ -566,12 +566,16 @@ public class Note implements Serializable, ParagraphJobListener {
     if (null == cronExecutingUser) {
       cronExecutingUser = "anonymous";
     }
+    AuthenticationInfo authenticationInfo = new AuthenticationInfo();
+    authenticationInfo.setUser(cronExecutingUser);
+    runAll(authenticationInfo);
+  }
+
+  public void runAll(AuthenticationInfo authenticationInfo) {
     for (Paragraph p : getParagraphs()) {
       if (!p.isEnabled()) {
         continue;
       }
-      AuthenticationInfo authenticationInfo = new AuthenticationInfo();
-      authenticationInfo.setUser(cronExecutingUser);
       p.setAuthenticationInfo(authenticationInfo);
       run(p.getId());
     }


Mime
View raw message