HADOOP-15506. Upgrade Azure Storage Sdk version to 7.0.0 and update corresponding code blocks.
Contributed by Esfandiar Manii.
(cherry picked from commit d901be6795
)
This commit is contained in:
parent
425fe4e217
commit
baac7c2b28
|
@ -1182,7 +1182,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.microsoft.azure</groupId>
|
<groupId>com.microsoft.azure</groupId>
|
||||||
<artifactId>azure-storage</artifactId>
|
<artifactId>azure-storage</artifactId>
|
||||||
<version>5.4.0</version>
|
<version>7.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -87,8 +87,10 @@ final class NativeAzureFileSystemHelper {
|
||||||
if (errorCode != null
|
if (errorCode != null
|
||||||
&& (errorCode.equals(StorageErrorCodeStrings.BLOB_NOT_FOUND)
|
&& (errorCode.equals(StorageErrorCodeStrings.BLOB_NOT_FOUND)
|
||||||
|| errorCode.equals(StorageErrorCodeStrings.RESOURCE_NOT_FOUND)
|
|| errorCode.equals(StorageErrorCodeStrings.RESOURCE_NOT_FOUND)
|
||||||
|
|| errorCode.equals(StorageErrorCodeStrings.CONTAINER_NOT_FOUND)
|
||||||
|| errorCode.equals(StorageErrorCode.BLOB_NOT_FOUND.toString())
|
|| 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class ITestContainerChecks extends AbstractWasbTestWithTimeout {
|
||||||
assertTrue("Should've thrown.", false);
|
assertTrue("Should've thrown.", false);
|
||||||
} catch (FileNotFoundException ex) {
|
} catch (FileNotFoundException ex) {
|
||||||
assertTrue("Unexpected exception: " + ex,
|
assertTrue("Unexpected exception: " + ex,
|
||||||
ex.getMessage().contains("does not exist."));
|
ex.getMessage().contains("is not found"));
|
||||||
}
|
}
|
||||||
assertFalse(container.exists());
|
assertFalse(container.exists());
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ public class ITestContainerChecks extends AbstractWasbTestWithTimeout {
|
||||||
assertTrue("Should've thrown.", false);
|
assertTrue("Should've thrown.", false);
|
||||||
} catch (FileNotFoundException ex) {
|
} catch (FileNotFoundException ex) {
|
||||||
assertTrue("Unexpected exception: " + ex,
|
assertTrue("Unexpected exception: " + ex,
|
||||||
ex.getMessage().contains("does not exist."));
|
ex.getMessage().contains("is not found"));
|
||||||
}
|
}
|
||||||
assertFalse(container.exists());
|
assertFalse(container.exists());
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ public class ITestContainerChecks extends AbstractWasbTestWithTimeout {
|
||||||
assertTrue("Should've thrown.", false);
|
assertTrue("Should've thrown.", false);
|
||||||
} catch (FileNotFoundException ex) {
|
} catch (FileNotFoundException ex) {
|
||||||
assertTrue("Unexpected exception: " + ex,
|
assertTrue("Unexpected exception: " + ex,
|
||||||
ex.getMessage().contains("does not exist."));
|
ex.getMessage().contains("is not found"));
|
||||||
}
|
}
|
||||||
assertFalse(container.exists());
|
assertFalse(container.exists());
|
||||||
|
|
||||||
|
@ -165,6 +165,9 @@ public class ITestContainerChecks extends AbstractWasbTestWithTimeout {
|
||||||
assertFalse(fs.rename(foo, bar));
|
assertFalse(fs.rename(foo, bar));
|
||||||
assertFalse(container.exists());
|
assertFalse(container.exists());
|
||||||
|
|
||||||
|
// Create a container outside of the WASB FileSystem
|
||||||
|
container.create();
|
||||||
|
|
||||||
// But a write should.
|
// But a write should.
|
||||||
assertTrue(fs.createNewFile(foo));
|
assertTrue(fs.createNewFile(foo));
|
||||||
assertTrue(container.exists());
|
assertTrue(container.exists());
|
||||||
|
|
Loading…
Reference in New Issue