mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Rework sync with secondary storage when reload notebooks
- Address @khalidhuseynov comment
This commit is contained in:
parent
5423e3c160
commit
64e1a28c04
2 changed files with 10 additions and 1 deletions
|
|
@ -38,6 +38,7 @@ import org.apache.zeppelin.interpreter.InterpreterGroup;
|
|||
import org.apache.zeppelin.interpreter.InterpreterSetting;
|
||||
import org.apache.zeppelin.interpreter.remote.RemoteAngularObjectRegistry;
|
||||
import org.apache.zeppelin.notebook.repo.NotebookRepo;
|
||||
import org.apache.zeppelin.notebook.repo.NotebookRepoSync;
|
||||
import org.apache.zeppelin.scheduler.SchedulerFactory;
|
||||
import org.apache.zeppelin.search.SearchService;
|
||||
import org.quartz.CronScheduleBuilder;
|
||||
|
|
@ -334,6 +335,14 @@ public class Notebook {
|
|||
synchronized (notes) {
|
||||
notes.clear();
|
||||
}
|
||||
|
||||
if (notebookRepo instanceof NotebookRepoSync) {
|
||||
NotebookRepoSync mainRepo = (NotebookRepoSync) notebookRepo;
|
||||
if (mainRepo.getRepoCount() > 1) {
|
||||
mainRepo.sync();
|
||||
}
|
||||
}
|
||||
|
||||
List<NoteInfo> noteInfos = notebookRepo.list();
|
||||
for (NoteInfo info : noteInfos) {
|
||||
loadNoteFromRepo(info.getId());
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ public class NotebookRepoSync implements NotebookRepo {
|
|||
}
|
||||
}
|
||||
|
||||
int getRepoCount() {
|
||||
public int getRepoCount() {
|
||||
return repos.size();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue