HADOOP-16074. WASB: Update container not found error code.

Contributed by Da Zhou.
This commit is contained in:
Da Zhou 2019-02-05 14:39:45 +00:00 committed by Steve Loughran
parent 9ace37b119
commit ba9efe06fa
No known key found for this signature in database
GPG Key ID: D22CF846DBB162A0
2 changed files with 2 additions and 8 deletions

View File

@ -70,7 +70,7 @@ import com.microsoft.azure.storage.RetryNoRetry;
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 @@ public class AzureNativeFileSystemStore implements NativeFileSystemStore {
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 {

View File

@ -119,9 +119,6 @@ public class ITestContainerChecks extends AbstractWasbTestWithTimeout {
}
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 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());