Repository: zeppelin
Updated Branches:
  refs/heads/master c65ef0788 -> 91ce62fa9


[ZEPPELIN-1842] sync on start when anonymous allowed

### What is this PR for?
this is to keep backward compatibility when it's possible to sync on start in 
anonymous mode.

### What type of PR is it?
Bug Fix | Improvement

### Todos
* [x] - add sync call with condition

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

### How should this be tested?
1. enable secondary storage (e.g. s3, azure, 
[here](https://zeppelin.apache.org/docs/0.7.0-SNAPSHOT/storage/storage.html#notebook-storage-in-s3))
2. keep anonymous mode without authentication
3. start zeppelin -> notes should be synced

### 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: Khalid Huseynov <khalid...@gmail.com>

Closes #1786 from khalidhuseynov/fix/sync-anonymous and squashes the following 
commits:

66bfa9e [Khalid Huseynov] sync on start when anonymous allowed


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

Branch: refs/heads/master
Commit: 91ce62fa9da673f4fe9f63dd477402ecd7f4d1ea
Parents: c65ef07
Author: Khalid Huseynov <khalid...@gmail.com>
Authored: Tue Dec 20 18:28:01 2016 +0900
Committer: ahyoungryu <ahyoung...@apache.org>
Committed: Tue Dec 27 10:17:36 2016 +0900

----------------------------------------------------------------------
 .../org/apache/zeppelin/notebook/repo/NotebookRepoSync.java  | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/91ce62fa/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/NotebookRepoSync.java
----------------------------------------------------------------------
diff --git 
a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/NotebookRepoSync.java
 
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/NotebookRepoSync.java
index 1a513aa..0ca7d69 100644
--- 
a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/NotebookRepoSync.java
+++ 
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/NotebookRepoSync.java
@@ -93,6 +93,14 @@ public class NotebookRepoSync implements NotebookRepo {
       LOG.info("No storage could be initialized, using default {} storage", 
defaultStorage);
       initializeDefaultStorage(conf);
     }
+    // sync for anonymous mode on start
+    if (getRepoCount() > 1 && 
conf.getBoolean(ConfVars.ZEPPELIN_ANONYMOUS_ALLOWED)) {
+      try {
+        sync(AuthenticationInfo.ANONYMOUS);
+      } catch (IOException e) {
+        LOG.error("Couldn't sync on start ", e);
+      }
+    }
   }
 
   @SuppressWarnings("static-access")

Reply via email to