use of alluxio.client.lineage.LineageFileSystem in project alluxio by Alluxio.
the class LineageMasterIntegrationTest method lineageCompleteAndAsyncPersist.
@Test
public void lineageCompleteAndAsyncPersist() throws Exception {
try (LineageMasterClient lineageMasterClient = getLineageMasterClient()) {
ArrayList<String> outFiles = new ArrayList<>();
Collections.addAll(outFiles, OUT_FILE);
lineageMasterClient.createLineage(new ArrayList<String>(), outFiles, mJob);
CreateFileOptions options = CreateFileOptions.defaults().setWriteType(WriteType.MUST_CACHE).setBlockSizeBytes(BLOCK_SIZE_BYTES);
LineageFileSystem fs = (LineageFileSystem) mLocalAlluxioClusterResource.get().getClient();
FileOutStream outputStream = fs.createFile(new AlluxioURI(OUT_FILE), options);
outputStream.write(1);
outputStream.close();
List<LineageInfo> infos = lineageMasterClient.getLineageInfoList();
AlluxioURI uri = new AlluxioURI(infos.get(0).getOutputFiles().get(0));
URIStatus status = getFileSystemMasterClient().getStatus(uri);
Assert.assertNotEquals(PersistenceState.PERSISTED.toString(), status.getPersistenceState());
Assert.assertTrue(status.isCompleted());
IntegrationTestUtils.waitForPersist(mLocalAlluxioClusterResource, uri);
// worker notifies the master
status = getFileSystemMasterClient().getStatus(uri);
Assert.assertEquals(PersistenceState.PERSISTED.toString(), status.getPersistenceState());
}
}
Aggregations