use of com.microsoft.azure.storage.blob.BlobOutputStream in project hadoop by apache.
the class TestOutOfBandAzureBlobOperationsLive method outOfBandFolder_firstLevelFolderDelete.
@Test
public void outOfBandFolder_firstLevelFolderDelete() throws Exception {
CloudBlockBlob blob = testAccount.getBlobReference("folderW/file");
BlobOutputStream s = blob.openOutputStream();
s.close();
assertTrue(fs.exists(new Path("/folderW")));
assertTrue(fs.exists(new Path("/folderW/file")));
assertTrue(fs.delete(new Path("/folderW"), true));
}
use of com.microsoft.azure.storage.blob.BlobOutputStream in project hadoop by apache.
the class TestOutOfBandAzureBlobOperationsLive method outOfBandFolder_rename.
// scenario for this particular test described at MONARCH-HADOOP-764
@Test
public void outOfBandFolder_rename() throws Exception {
// NOTE: manual use of CloubBlockBlob targets working directory explicitly.
// WASB driver methods prepend working directory implicitly.
String workingDir = "user/" + UserGroupInformation.getCurrentUser().getShortUserName() + "/";
CloudBlockBlob blob = testAccount.getBlobReference(workingDir + "testFolder4/a/input/file");
BlobOutputStream s = blob.openOutputStream();
s.close();
Path srcFilePath = new Path("testFolder4/a/input/file");
assertTrue(fs.exists(srcFilePath));
Path destFilePath = new Path("testFolder4/a/input/file2");
fs.rename(srcFilePath, destFilePath);
}
use of com.microsoft.azure.storage.blob.BlobOutputStream in project hadoop by apache.
the class TestOutOfBandAzureBlobOperationsLive method outOfBandFolder_siblingCreate.
// scenario for this particular test described at MONARCH-HADOOP-764
@Test
public void outOfBandFolder_siblingCreate() throws Exception {
// NOTE: manual use of CloubBlockBlob targets working directory explicitly.
// WASB driver methods prepend working directory implicitly.
String workingDir = "user/" + UserGroupInformation.getCurrentUser().getShortUserName() + "/";
CloudBlockBlob blob = testAccount.getBlobReference(workingDir + "testFolder3/a/input/file");
BlobOutputStream s = blob.openOutputStream();
s.close();
assertTrue(fs.exists(new Path("testFolder3/a/input/file")));
Path targetFile = new Path("testFolder3/a/input/file2");
FSDataOutputStream s2 = fs.create(targetFile);
s2.close();
}
use of com.microsoft.azure.storage.blob.BlobOutputStream in project hadoop by apache.
the class TestOutOfBandAzureBlobOperationsLive method outOfBandFolder_rootFileDelete.
@Test
public void outOfBandFolder_rootFileDelete() throws Exception {
CloudBlockBlob blob = testAccount.getBlobReference("fileY");
BlobOutputStream s = blob.openOutputStream();
s.close();
assertTrue(fs.exists(new Path("/fileY")));
assertTrue(fs.delete(new Path("/fileY"), true));
}
use of com.microsoft.azure.storage.blob.BlobOutputStream in project hadoop by apache.
the class TestOutOfBandAzureBlobOperationsLive method outOfBandFolder_parentDelete.
// scenario for this particular test described at MONARCH-HADOOP-764
@Test
public void outOfBandFolder_parentDelete() throws Exception {
// NOTE: manual use of CloubBlockBlob targets working directory explicitly.
// WASB driver methods prepend working directory implicitly.
String workingDir = "user/" + UserGroupInformation.getCurrentUser().getShortUserName() + "/";
CloudBlockBlob blob = testAccount.getBlobReference(workingDir + "testFolder2/a/input/file");
BlobOutputStream s = blob.openOutputStream();
s.close();
assertTrue(fs.exists(new Path("testFolder2/a/input/file")));
Path targetFolder = new Path("testFolder2/a/input");
assertTrue(fs.delete(targetFolder, true));
}
Aggregations