Search in sources :

Example 6 with UfsJournal

use of alluxio.master.journal.ufs.UfsJournal in project alluxio by Alluxio.

the class UfsJournalIntegrationTest method completedEditLogDeletion.

/**
 * Tests completed edit log deletion.
 */
@Test
public void completedEditLogDeletion() throws Exception {
    for (int i = 0; i < 124; i++) {
        mFileSystem.createFile(new AlluxioURI("/a" + i), CreateFilePOptions.newBuilder().setBlockSizeBytes((i + 10) / 10 * 64).build()).close();
    }
    mLocalAlluxioCluster.stopFS();
    String journalFolder = PathUtils.concatPath(mLocalAlluxioCluster.getLocalAlluxioMaster().getJournalFolder(), Constants.FILE_SYSTEM_MASTER_NAME);
    UfsJournal journal = new UfsJournal(new URI(journalFolder), new NoopMaster(), 0, Collections::emptySet);
    URI completedLocation = journal.getLogDir();
    Assert.assertTrue(UnderFileSystem.Factory.create(completedLocation.toString(), UnderFileSystemConfiguration.defaults(ServerConfiguration.global())).listStatus(completedLocation.toString()).length > 1);
    multiEditLogTestUtil();
    Assert.assertTrue(UnderFileSystem.Factory.create(completedLocation.toString(), UnderFileSystemConfiguration.defaults(ServerConfiguration.global())).listStatus(completedLocation.toString()).length > 1);
    multiEditLogTestUtil();
}
Also used : Collections(java.util.Collections) AlluxioURI(alluxio.AlluxioURI) URI(java.net.URI) UfsJournal(alluxio.master.journal.ufs.UfsJournal) AlluxioURI(alluxio.AlluxioURI) NoopMaster(alluxio.master.NoopMaster) BaseIntegrationTest(alluxio.testutils.BaseIntegrationTest) Test(org.junit.Test)

Aggregations

NoopMaster (alluxio.master.NoopMaster)6 UfsJournal (alluxio.master.journal.ufs.UfsJournal)6 Collections (java.util.Collections)5 AlluxioURI (alluxio.AlluxioURI)4 URI (java.net.URI)4 Test (org.junit.Test)3 BaseIntegrationTest (alluxio.testutils.BaseIntegrationTest)2 JournalReader (alluxio.master.journal.JournalReader)1 CheckpointInputStream (alluxio.master.journal.checkpoint.CheckpointInputStream)1 UfsJournalReader (alluxio.master.journal.ufs.UfsJournalReader)1 UfsJournalSnapshot (alluxio.master.journal.ufs.UfsJournalSnapshot)1 UfsJournalSystem (alluxio.master.journal.ufs.UfsJournalSystem)1 MultiProcessCluster (alluxio.multi.process.MultiProcessCluster)1 Journal (alluxio.proto.journal.Journal)1 UfsStatus (alluxio.underfs.UfsStatus)1 BufferedOutputStream (java.io.BufferedOutputStream)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 PrintStream (java.io.PrintStream)1 Path (java.nio.file.Path)1