You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by cn...@apache.org on 2015/01/30 02:08:18 UTC
[1/2] hadoop git commit: HADOOP-11523. StorageException complaining "
no lease ID" when updating FolderLastModifiedTime in WASB. Contributed by Duo
Xu.
Repository: hadoop
Updated Branches:
refs/heads/branch-2 e8d154bae -> 4607ca285
refs/heads/trunk e36ef3b40 -> f2c91098c
HADOOP-11523. StorageException complaining " no lease ID" when updating FolderLastModifiedTime in WASB. Contributed by Duo Xu.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/f2c91098
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/f2c91098
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/f2c91098
Branch: refs/heads/trunk
Commit: f2c91098c400da6db0f5e8e49e9bf0e6444af531
Parents: e36ef3b
Author: cnauroth <cn...@apache.org>
Authored: Thu Jan 29 17:02:38 2015 -0800
Committer: cnauroth <cn...@apache.org>
Committed: Thu Jan 29 17:02:38 2015 -0800
----------------------------------------------------------------------
hadoop-common-project/hadoop-common/CHANGES.txt | 3 ++
.../hadoop/fs/azure/NativeAzureFileSystem.java | 32 +++++++++++++++++++-
2 files changed, 34 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/f2c91098/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index c71d35a..f26177d 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -797,6 +797,9 @@ Release 2.7.0 - UNRELEASED
HADOOP-11403. Avoid using sys_errlist on Solaris, which lacks support for it
(Malcolm Kavalsky via Colin P. McCabe)
+ HADOOP-11523. StorageException complaining " no lease ID" when updating
+ FolderLastModifiedTime in WASB. (Duo Xu via cnauroth)
+
Release 2.6.1 - UNRELEASED
INCOMPATIBLE CHANGES
http://git-wip-us.apache.org/repos/asf/hadoop/blob/f2c91098/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 c136002..0248b85 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
@@ -2040,7 +2040,37 @@ public class NativeAzureFileSystem extends FileSystem {
createPermissionStatus(FsPermission.getDefault()));
}
- store.updateFolderLastModifiedTime(parentKey, null);
+ if (store.isAtomicRenameKey(parentKey)) {
+ SelfRenewingLease lease = null;
+ try {
+ lease = leaseSourceFolder(parentKey);
+ store.updateFolderLastModifiedTime(parentKey, lease);
+ } catch (AzureException e) {
+ String errorCode = "";
+ try {
+ StorageException e2 = (StorageException) e.getCause();
+ errorCode = e2.getErrorCode();
+ } catch (Exception e3) {
+ // do nothing if cast fails
+ }
+ if (errorCode.equals("BlobNotFound")) {
+ throw new FileNotFoundException("Folder does not exist: " + parentKey);
+ }
+ LOG.warn("Got unexpected exception trying to get lease on "
+ + parentKey + ". " + e.getMessage());
+ throw e;
+ } finally {
+ try {
+ if (lease != null) {
+ lease.free();
+ }
+ } catch (Exception e) {
+ LOG.error("Unable to free lease on " + parentKey, e);
+ }
+ }
+ } else {
+ store.updateFolderLastModifiedTime(parentKey, null);
+ }
}
}
}
[2/2] hadoop git commit: HADOOP-11523. StorageException complaining "
no lease ID" when updating FolderLastModifiedTime in WASB. Contributed by Duo
Xu.
Posted by cn...@apache.org.
HADOOP-11523. StorageException complaining " no lease ID" when updating FolderLastModifiedTime in WASB. Contributed by Duo Xu.
(cherry picked from commit f2c91098c400da6db0f5e8e49e9bf0e6444af531)
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/4607ca28
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/4607ca28
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/4607ca28
Branch: refs/heads/branch-2
Commit: 4607ca28544a6b8ff535f5ac9d1069eed4f8d803
Parents: e8d154b
Author: cnauroth <cn...@apache.org>
Authored: Thu Jan 29 17:02:38 2015 -0800
Committer: cnauroth <cn...@apache.org>
Committed: Thu Jan 29 17:02:48 2015 -0800
----------------------------------------------------------------------
hadoop-common-project/hadoop-common/CHANGES.txt | 3 ++
.../hadoop/fs/azure/NativeAzureFileSystem.java | 32 +++++++++++++++++++-
2 files changed, 34 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/4607ca28/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index 55f2a99..217f06e 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -441,6 +441,9 @@ Release 2.7.0 - UNRELEASED
HADOOP-11403. Avoid using sys_errlist on Solaris, which lacks support for it
(Malcolm Kavalsky via Colin P. McCabe)
+ HADOOP-11523. StorageException complaining " no lease ID" when updating
+ FolderLastModifiedTime in WASB. (Duo Xu via cnauroth)
+
Release 2.6.1 - UNRELEASED
INCOMPATIBLE CHANGES
http://git-wip-us.apache.org/repos/asf/hadoop/blob/4607ca28/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 c136002..0248b85 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
@@ -2040,7 +2040,37 @@ public class NativeAzureFileSystem extends FileSystem {
createPermissionStatus(FsPermission.getDefault()));
}
- store.updateFolderLastModifiedTime(parentKey, null);
+ if (store.isAtomicRenameKey(parentKey)) {
+ SelfRenewingLease lease = null;
+ try {
+ lease = leaseSourceFolder(parentKey);
+ store.updateFolderLastModifiedTime(parentKey, lease);
+ } catch (AzureException e) {
+ String errorCode = "";
+ try {
+ StorageException e2 = (StorageException) e.getCause();
+ errorCode = e2.getErrorCode();
+ } catch (Exception e3) {
+ // do nothing if cast fails
+ }
+ if (errorCode.equals("BlobNotFound")) {
+ throw new FileNotFoundException("Folder does not exist: " + parentKey);
+ }
+ LOG.warn("Got unexpected exception trying to get lease on "
+ + parentKey + ". " + e.getMessage());
+ throw e;
+ } finally {
+ try {
+ if (lease != null) {
+ lease.free();
+ }
+ } catch (Exception e) {
+ LOG.error("Unable to free lease on " + parentKey, e);
+ }
+ }
+ } else {
+ store.updateFolderLastModifiedTime(parentKey, null);
+ }
}
}
}