Repository: hadoop Updated Branches: refs/heads/branch-2 8dc8ecbb9 -> 2d059b5a4
HADOOP-14048. REDO operation of WASB#AtomicRename should create placeholder blob for destination folder. Contributed by NITIN VERMA (cherry picked from commit c571cda5c7d929477961dfff4176d7de4944d874) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/2d059b5a Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/2d059b5a Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/2d059b5a Branch: refs/heads/branch-2 Commit: 2d059b5a402ff8adbeaafbb74e1701ab1f470b72 Parents: 8dc8ecb Author: Mingliang Liu <[email protected]> Authored: Mon Mar 6 16:53:30 2017 -0800 Committer: Mingliang Liu <[email protected]> Committed: Mon Mar 6 17:01:01 2017 -0800 ---------------------------------------------------------------------- .../org/apache/hadoop/fs/azure/NativeAzureFileSystem.java | 10 ++++++++++ 1 file changed, 10 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/2d059b5a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystem.java ---------------------------------------------------------------------- diff --git a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystem.java b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystem.java index 012329c..a30c007 100644 --- a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystem.java +++ b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystem.java @@ -566,6 +566,16 @@ public class NativeAzureFileSystem extends FileSystem { // Remove the source folder. Don't check explicitly if it exists, // to avoid triggering redo recursively. try { + // Rename the source folder 0-byte root file + // as destination folder 0-byte root file. + FileMetadata srcMetaData = this.getSourceMetadata(); + if (srcMetaData.getBlobMaterialization() == BlobMaterialization.Explicit) { + // We already have a lease. So let's just rename the source blob + // as destination blob under same lease. + fs.getStoreInterface().rename(this.getSrcKey(), this.getDstKey(), false, lease); + } + + // Now we can safely delete the source folder. fs.getStoreInterface().delete(srcKey, lease); } catch (Exception e) { LOG.info("Unable to delete source folder during folder rename redo. " --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
