Repository: incubator-zeppelin
Updated Branches:
  refs/heads/master 4af49ca8e -> 74b1f0c97


Improve storing notebook.

This PR relates to: https://issues.apache.org/jira/browse/ZEPPELIN-454
Storing the notebook process changed. (store".note.json" temporary file first 
and if  it is succeed ".note.json" move to "note.json")

Author: astroshim <[email protected]>

Closes #457 from astroshim/issue-454 and squashes the following commits:

5a66bff [astroshim] change way storing notebook.


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

Branch: refs/heads/master
Commit: 74b1f0c977628bd2b24483a7a0fa3c25ebf42776
Parents: 4af49ca
Author: astroshim <[email protected]>
Authored: Sun Nov 22 01:27:59 2015 +0900
Committer: Lee moon soo <[email protected]>
Committed: Thu Nov 26 23:00:03 2015 +0900

----------------------------------------------------------------------
 .../java/org/apache/zeppelin/notebook/repo/VFSNotebookRepo.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/74b1f0c9/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/VFSNotebookRepo.java
----------------------------------------------------------------------
diff --git 
a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/VFSNotebookRepo.java
 
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/VFSNotebookRepo.java
index 3039f80..58f36f2 100644
--- 
a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/VFSNotebookRepo.java
+++ 
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/VFSNotebookRepo.java
@@ -214,11 +214,12 @@ public class VFSNotebookRepo implements NotebookRepo {
       throw new IOException(noteDir.getName().toString() + " is not a 
directory");
     }
 
-    FileObject noteJson = noteDir.resolveFile("note.json", NameScope.CHILD);
+    FileObject noteJson = noteDir.resolveFile(".note.json", NameScope.CHILD);
     // false means not appending. creates file if not exists
     OutputStream out = noteJson.getContent().getOutputStream(false);
     out.write(json.getBytes(conf.getString(ConfVars.ZEPPELIN_ENCODING)));
     out.close();
+    noteJson.moveTo(noteDir.resolveFile("note.json", NameScope.CHILD));
   }
 
   @Override

Reply via email to