diff --git a/hadoop-project/pom.xml b/hadoop-project/pom.xml index 8812132de45..f1ab70d0cca 100644 --- a/hadoop-project/pom.xml +++ b/hadoop-project/pom.xml @@ -1100,6 +1100,12 @@ 2.9.1 + + com.microsoft.azure + azure-storage + 7.0.0 + + com.aliyun.oss aliyun-sdk-oss diff --git a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystemHelper.java b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystemHelper.java index 754f3431426..e4ad70cedb2 100644 --- a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystemHelper.java +++ b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystemHelper.java @@ -87,8 +87,10 @@ final class NativeAzureFileSystemHelper { if (errorCode != null && (errorCode.equals(StorageErrorCodeStrings.BLOB_NOT_FOUND) || errorCode.equals(StorageErrorCodeStrings.RESOURCE_NOT_FOUND) + || errorCode.equals(StorageErrorCodeStrings.CONTAINER_NOT_FOUND) || errorCode.equals(StorageErrorCode.BLOB_NOT_FOUND.toString()) - || errorCode.equals(StorageErrorCode.RESOURCE_NOT_FOUND.toString()))) { + || errorCode.equals(StorageErrorCode.RESOURCE_NOT_FOUND.toString()) + || errorCode.equals(StorageErrorCode.CONTAINER_NOT_FOUND.toString()))) { return true; } diff --git a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/ITestContainerChecks.java b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/ITestContainerChecks.java index 417ee0e1a81..cb8e0c9be77 100644 --- a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/ITestContainerChecks.java +++ b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/ITestContainerChecks.java @@ -75,7 +75,7 @@ public class ITestContainerChecks extends AbstractWasbTestWithTimeout { assertTrue("Should've thrown.", false); } catch (FileNotFoundException ex) { assertTrue("Unexpected exception: " + ex, - ex.getMessage().contains("does not exist.")); + ex.getMessage().contains("is not found")); } assertFalse(container.exists()); @@ -115,7 +115,7 @@ public class ITestContainerChecks extends AbstractWasbTestWithTimeout { assertTrue("Should've thrown.", false); } catch (FileNotFoundException ex) { assertTrue("Unexpected exception: " + ex, - ex.getMessage().contains("does not exist.")); + ex.getMessage().contains("is not found")); } assertFalse(container.exists()); @@ -143,7 +143,7 @@ public class ITestContainerChecks extends AbstractWasbTestWithTimeout { assertTrue("Should've thrown.", false); } catch (FileNotFoundException ex) { assertTrue("Unexpected exception: " + ex, - ex.getMessage().contains("does not exist.")); + ex.getMessage().contains("is not found")); } assertFalse(container.exists()); @@ -165,6 +165,9 @@ public class ITestContainerChecks extends AbstractWasbTestWithTimeout { assertFalse(fs.rename(foo, bar)); assertFalse(container.exists()); + // Create a container outside of the WASB FileSystem + container.create(); + // But a write should. assertTrue(fs.createNewFile(foo)); assertTrue(container.exists());