You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by li...@apache.org on 2019/06/15 14:56:27 UTC

[zeppelin] branch master updated: [ZEPPELIN-4195] Fixed deleted note does not take effect in the file system

This is an automated email from the ASF dual-hosted git repository.

liuxun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zeppelin.git


The following commit(s) were added to refs/heads/master by this push:
     new 57a2d34  [ZEPPELIN-4195] Fixed deleted note does not take effect in the file system
57a2d34 is described below

commit 57a2d34858026532fbf31827255d17f5cd62aaae
Author: Xun Liu <li...@apache.org>
AuthorDate: Fri Jun 14 16:18:58 2019 +0800

    [ZEPPELIN-4195] Fixed deleted note does not take effect in the file system
    
    ### What is this PR for?
    Because the latest note storage is saved in a real file directory.
    When deleting the note,
    Move /note-storage-dir/note1 directly to /note-storage-dir/~Trash/note1,
    If the /note-storage-dir/~Trash directory does not exist, then moving the note will fail.
    
    ### What type of PR is it?
    [Bug Fix]
    
    ### What is the Jira issue?
    * https://issues.apache.org/jira/browse/ZEPPELIN-4195
    
    ### How should this be tested?
    * [CI Pass](https://travis-ci.org/liuxunorg/zeppelin/builds/545631231)
    ### Screenshots (if appropriate)
    
    ### Questions:
    * Does the licenses files need update?
    * Is there breaking changes for older versions?
    * Does this needs documentation?
    
    Author: Xun Liu <li...@apache.org>
    
    Closes #3385 from liuxunorg/ZEPPELIN-4195 and squashes the following commits:
    
    d08f38bfc [Xun Liu] [ZEPPELIN-4195] Fixed deleted note does not take effect in the file system
---
 .../org/apache/zeppelin/notebook/repo/FileSystemNotebookRepo.java     | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/zeppelin-plugins/notebookrepo/filesystem/src/main/java/org/apache/zeppelin/notebook/repo/FileSystemNotebookRepo.java b/zeppelin-plugins/notebookrepo/filesystem/src/main/java/org/apache/zeppelin/notebook/repo/FileSystemNotebookRepo.java
index e7b03ca..f486451 100644
--- a/zeppelin-plugins/notebookrepo/filesystem/src/main/java/org/apache/zeppelin/notebook/repo/FileSystemNotebookRepo.java
+++ b/zeppelin-plugins/notebookrepo/filesystem/src/main/java/org/apache/zeppelin/notebook/repo/FileSystemNotebookRepo.java
@@ -91,12 +91,16 @@ public class FileSystemNotebookRepo implements NotebookRepo {
                    AuthenticationInfo subject) throws IOException {
     Path src = new Path(notebookDir, buildNoteFileName(noteId, notePath));
     Path dest = new Path(notebookDir, buildNoteFileName(noteId, newNotePath));
+    // [ZEPPELIN-4195] newNotePath parent path maybe not exist
+    this.fs.tryMkDir(new Path(notebookDir, newNotePath.substring(1)).getParent());
     this.fs.move(src, dest);
   }
 
   @Override
   public void move(String folderPath, String newFolderPath, AuthenticationInfo subject)
       throws IOException {
+    // [ZEPPELIN-4195] newFolderPath parent path maybe not exist
+    this.fs.tryMkDir(new Path(notebookDir, folderPath.substring(1)).getParent());
     this.fs.move(new Path(notebookDir, folderPath.substring(1)),
         new Path(notebookDir, newFolderPath.substring(1)));
   }