Remove ZEPPELIN_NOTEBOOK_RELOAD_FROM_STORAGE env variable

This commit is contained in:
Mina Lee 2015-12-26 17:53:46 -08:00
parent 3fc9ad0dea
commit b26dabf818
3 changed files with 0 additions and 54 deletions

View file

@ -176,12 +176,6 @@ Configuration can be done by both environment variable(conf/zeppelin-env.sh) and
<td>org.apache.zeppelin.notebook.repo.VFSNotebookRepo</td>
<td>Comma separated list of notebook storage</td>
</tr>
<tr>
<td>ZEPPELIN_NOTEBOOK_RELOAD_FROM_STORAGE</td>
<td>zeppelin.notebook.reloadAllNotesFromStorage</td>
<td>false</td>
<td>Notebook list and contents will be always loaded from repository if set true. If set false, modified notebooks or new notebooks added on file system level won't be reflected on Zeppelin till user restarts Zeppelin.</td>
</tr>
<tr>
<td>ZEPPELIN_INTERPRETERS</td>
<td>zeppelin.interpreters</td>

View file

@ -426,10 +426,6 @@ public class ZeppelinConfiguration extends XMLConfiguration {
ZEPPELIN_NOTEBOOK_S3_BUCKET("zeppelin.notebook.s3.bucket", "zeppelin"),
ZEPPELIN_NOTEBOOK_S3_USER("zeppelin.notebook.s3.user", "user"),
ZEPPELIN_NOTEBOOK_STORAGE("zeppelin.notebook.storage", VFSNotebookRepo.class.getName()),
// Notebook list and contents will be always loaded from repository if set true.
// If set false, modified notebooks or new notebooks added on file system level
// won't be reflected on Zeppelin till user restarts Zeppelin.
ZEPPELIN_NOTEBOOK_RELOAD_FROM_STORAGE("zeppelin.notebook.reloadAllNotesFromStorage", false),
ZEPPELIN_INTERPRETER_REMOTE_RUNNER("zeppelin.interpreter.remoterunner", "bin/interpreter.sh"),
// Decide when new note is created, interpreter settings will be binded automatically or not.
ZEPPELIN_NOTEBOOK_AUTO_INTERPRETER_BINDING("zeppelin.notebook.autoInterpreterBinding", true),

View file

@ -29,10 +29,8 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.io.FileUtils;
import org.apache.zeppelin.conf.ZeppelinConfiguration;
import org.apache.zeppelin.conf.ZeppelinConfiguration.ConfVars;
import org.apache.zeppelin.display.AngularObjectRegistry;
@ -47,7 +45,6 @@ import org.apache.zeppelin.scheduler.Job.Status;
import org.apache.zeppelin.scheduler.JobListener;
import org.apache.zeppelin.scheduler.SchedulerFactory;
import org.apache.zeppelin.search.SearchService;
import org.apache.zeppelin.search.LuceneSearch;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@ -121,47 +118,6 @@ public class NotebookTest implements JobListenerFactory{
assertEquals("repl2: hello world", p2.getResult().message());
}
@Test
public void testGetAllNotes() throws IOException {
// get all notes after copy the {notebookId}/note.json into notebookDir
File srcDir = new File("src/test/resources/2A94M5J1Z");
File destDir = new File(notebookDir.getAbsolutePath() + "/2A94M5J1Z");
try {
FileUtils.copyDirectory(srcDir, destDir);
} catch (IOException e) {
e.printStackTrace();
}
Note copiedNote = notebookRepo.get("2A94M5J1Z");
// when ZEPPELIN_NOTEBOOK_GET_FROM_REPO set to be false
System.setProperty(ConfVars.ZEPPELIN_NOTEBOOK_RELOAD_FROM_STORAGE.getVarName(), "false");
List<Note> notes = notebook.getAllNotes();
assertEquals(notes.size(), 0);
// when ZEPPELIN_NOTEBOOK_GET_FROM_REPO set to be true
System.setProperty(ConfVars.ZEPPELIN_NOTEBOOK_RELOAD_FROM_STORAGE.getVarName(), "true");
notes = notebook.getAllNotes();
assertEquals(notes.size(), 1);
assertEquals(notes.get(0).id(), copiedNote.id());
assertEquals(notes.get(0).getName(), copiedNote.getName());
assertEquals(notes.get(0).getParagraphs(), copiedNote.getParagraphs());
// get all notes after remove the {notebookId}/note.json from notebookDir
// when ZEPPELIN_NOTEBOOK_GET_FROM_REPO set to be false
System.setProperty(ConfVars.ZEPPELIN_NOTEBOOK_RELOAD_FROM_STORAGE.getVarName(), "false");
// delete the notebook
FileUtils.deleteDirectory(destDir);
notes = notebook.getAllNotes();
assertEquals(notes.size(), 1);
// when ZEPPELIN_NOTEBOOK_GET_FROM_REPO set to be true
System.setProperty(ConfVars.ZEPPELIN_NOTEBOOK_RELOAD_FROM_STORAGE.getVarName(), "true");
notes = notebook.getAllNotes();
assertEquals(notes.size(), 0);
}
@Test
public void testPersist() throws IOException, SchedulerException{
Note note = notebook.createNote();