felixcheung commented on a change in pull request #3320: [ZEPPELIN-3977].
Create shell script for converting old note file to new file
URL: https://github.com/apache/zeppelin/pull/3320#discussion_r263681130
##########
File path:
zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/NotebookRepoSync.java
##########
@@ -62,38 +62,51 @@ public void init(ZeppelinConfiguration conf) throws
IOException {
oneWaySync = conf.getBoolean(ConfVars.ZEPPELIN_NOTEBOOK_ONE_WAY_SYNC);
String allStorageClassNames = conf.getNotebookStorageClass().trim();
if (allStorageClassNames.isEmpty()) {
- allStorageClassNames = defaultStorage;
+ allStorageClassNames = DEFAULT_STORAGE;
LOGGER.warn("Empty ZEPPELIN_NOTEBOOK_STORAGE conf parameter, using
default {}",
- defaultStorage);
+ DEFAULT_STORAGE);
}
String[] storageClassNames = allStorageClassNames.split(",");
if (storageClassNames.length > getMaxRepoNum()) {
LOGGER.warn("Unsupported number {} of storage classes in
ZEPPELIN_NOTEBOOK_STORAGE : {}\n" +
"first {} will be used", storageClassNames.length,
allStorageClassNames, getMaxRepoNum());
}
+ // init the underlying NotebookRepo
for (int i = 0; i < Math.min(storageClassNames.length, getMaxRepoNum());
i++) {
NotebookRepo notebookRepo =
PluginManager.get().loadNotebookRepo(storageClassNames[i].trim());
if (notebookRepo != null) {
notebookRepo.init(conf);
repos.add(notebookRepo);
}
}
+
// couldn't initialize any storage, use default
if (getRepoCount() == 0) {
- LOGGER.info("No storage could be initialized, using default {} storage",
defaultStorage);
- NotebookRepo defaultNotebookRepo =
PluginManager.get().loadNotebookRepo(defaultStorage);
+ LOGGER.info("No storage could be initialized, using default {} storage",
DEFAULT_STORAGE);
+ NotebookRepo defaultNotebookRepo =
PluginManager.get().loadNotebookRepo(DEFAULT_STORAGE);
defaultNotebookRepo.init(conf);
repos.add(defaultNotebookRepo);
}
+ // sync for anonymous mode on start
+ if (getRepoCount() > 1 &&
conf.getBoolean(ConfVars.ZEPPELIN_ANONYMOUS_ALLOWED)) {
+ try {
+ sync(AuthenticationInfo.ANONYMOUS);
+ } catch (IOException e) {
+ LOGGER.error("Couldn't sync on start ", e);
Review comment:
"Couldn't sync anonymous mode on start"
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services