Search in sources :

Example 6 with LineageInfo

use of alluxio.wire.LineageInfo 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());
    }
}
Also used : CreateFileOptions(alluxio.client.file.options.CreateFileOptions) ArrayList(java.util.ArrayList) FileOutStream(alluxio.client.file.FileOutStream) LineageMasterClient(alluxio.client.lineage.LineageMasterClient) LineageFileSystem(alluxio.client.lineage.LineageFileSystem) URIStatus(alluxio.client.file.URIStatus) LineageInfo(alluxio.wire.LineageInfo) AlluxioURI(alluxio.AlluxioURI) Test(org.junit.Test)

Aggregations

LineageInfo (alluxio.wire.LineageInfo)6 AlluxioURI (alluxio.AlluxioURI)4 ArrayList (java.util.ArrayList)4 Test (org.junit.Test)4 URIStatus (alluxio.client.file.URIStatus)2 LineageMasterClient (alluxio.client.lineage.LineageMasterClient)2 Config (alluxio.LocalAlluxioClusterResource.Config)1 FileOutStream (alluxio.client.file.FileOutStream)1 CreateFileOptions (alluxio.client.file.options.CreateFileOptions)1 AlluxioLineage (alluxio.client.lineage.AlluxioLineage)1 LineageFileSystem (alluxio.client.lineage.LineageFileSystem)1 CommandLineJob (alluxio.job.CommandLineJob)1 JobConf (alluxio.job.JobConf)1 Lineage (alluxio.master.lineage.meta.Lineage)1 RestApiTest (alluxio.rest.RestApiTest)1 TestCase (alluxio.rest.TestCase)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 ImmutableList (com.google.common.collect.ImmutableList)1 List (java.util.List)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1