diff --git a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/AzureNativeFileSystemStore.java b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/AzureNativeFileSystemStore.java index e16fd6e522..39b7ef4879 100644 --- a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/AzureNativeFileSystemStore.java +++ b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/AzureNativeFileSystemStore.java @@ -70,7 +70,7 @@ import com.microsoft.azure.storage.StorageCredentials; import com.microsoft.azure.storage.StorageCredentialsAccountAndKey; import com.microsoft.azure.storage.StorageCredentialsSharedAccessSignature; -import com.microsoft.azure.storage.StorageErrorCode; +import com.microsoft.azure.storage.StorageErrorCodeStrings; import com.microsoft.azure.storage.StorageException; import com.microsoft.azure.storage.Constants; import com.microsoft.azure.storage.StorageEvent; @@ -1336,7 +1336,7 @@ private ContainerState checkContainer(ContainerAccessType accessType) container.downloadAttributes(getInstrumentedContext()); currentKnownContainerState = ContainerState.Unknown; } catch (StorageException ex) { - if (StorageErrorCode.RESOURCE_NOT_FOUND.toString() + if (StorageErrorCodeStrings.CONTAINER_NOT_FOUND.toString() .equals(ex.getErrorCode())) { currentKnownContainerState = ContainerState.DoesntExist; } else { 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 456e4b18bd..9d21444685 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 @@ -119,9 +119,6 @@ public void testContainerCreateAfterDoesNotExist() throws Exception { } assertFalse(container.exists()); - // Create a container outside of the WASB FileSystem - container.create(); - // Write should succeed assertTrue(fs.createNewFile(new Path("/foo"))); assertTrue(container.exists()); @@ -165,9 +162,6 @@ public String call() throws Exception { 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());