Search in sources :

Example 6 with NoopMaster

use of alluxio.master.NoopMaster in project alluxio by Alluxio.

the class UfsJournalIntegrationTest method deleteFsMasterJournalLogs.

private void deleteFsMasterJournalLogs() throws Exception {
    String journalFolder = mLocalAlluxioCluster.getLocalAlluxioMaster().getJournalFolder();
    UfsJournal journal = new UfsJournal(new URI(PathUtils.concatPath(journalFolder, Constants.FILE_SYSTEM_MASTER_NAME)), new NoopMaster(), 0, Collections::emptySet);
    if (UfsJournalSnapshot.getCurrentLog(journal) != null) {
        UnderFileSystem.Factory.create(journalFolder, ServerConfiguration.global()).deleteFile(UfsJournalSnapshot.getCurrentLog(journal).getLocation().toString());
    }
}
Also used : Collections(java.util.Collections) AlluxioURI(alluxio.AlluxioURI) URI(java.net.URI) UfsJournal(alluxio.master.journal.ufs.UfsJournal) NoopMaster(alluxio.master.NoopMaster)

Example 7 with NoopMaster

use of alluxio.master.NoopMaster in project alluxio by Alluxio.

the class TriggeredCheckpointTest method ufsJournal.

@Test
public void ufsJournal() throws Exception {
    int numFiles = 100;
    MultiProcessCluster cluster = MultiProcessCluster.newBuilder(PortCoordination.TRIGGERED_UFS_CHECKPOINT).setClusterName("TriggeredUfsCheckpointTest").addProperty(PropertyKey.MASTER_JOURNAL_TYPE, JournalType.UFS.toString()).addProperty(PropertyKey.MASTER_JOURNAL_CHECKPOINT_PERIOD_ENTRIES, String.valueOf(numFiles)).setNumMasters(1).setNumWorkers(1).build();
    try {
        cluster.start();
        cluster.waitForAllNodesRegistered(20 * Constants.SECOND_MS);
        // Get enough journal entries
        createFiles(cluster, numFiles);
        // Trigger checkpoint
        Assert.assertEquals(cluster.getMasterAddresses().get(0).getHostname(), cluster.getMetaMasterClient().checkpoint());
        String journalLocation = cluster.getJournalDir();
        UfsJournal ufsJournal = new UfsJournal(URIUtils.appendPathOrDie(new URI(journalLocation), Constants.FILE_SYSTEM_MASTER_NAME), new NoopMaster(""), 0, Collections::emptySet);
        Assert.assertEquals(1, UfsJournalSnapshot.getSnapshot(ufsJournal).getCheckpoints().size());
        validateCheckpointInClusterRestart(cluster);
        cluster.notifySuccess();
    } finally {
        cluster.destroy();
    }
}
Also used : MultiProcessCluster(alluxio.multi.process.MultiProcessCluster) Collections(java.util.Collections) AlluxioURI(alluxio.AlluxioURI) URI(java.net.URI) UfsJournal(alluxio.master.journal.ufs.UfsJournal) NoopMaster(alluxio.master.NoopMaster) Test(org.junit.Test)

Example 8 with NoopMaster

use of alluxio.master.NoopMaster in project alluxio by Alluxio.

the class UfsJournalLogWriterTest method before.

@Before
public void before() throws Exception {
    URI location = URIUtils.appendPathOrDie(new URI(mFolder.newFolder().getAbsolutePath()), "FileSystemMaster");
    mUfs = Mockito.spy(UnderFileSystem.Factory.create(location.toString(), ServerConfiguration.global()));
    mJournal = new UfsJournal(location, new NoopMaster(), mUfs, 0, Collections::emptySet);
    mJournal.start();
    mJournal.gainPrimacy();
}
Also used : URI(java.net.URI) NoopMaster(alluxio.master.NoopMaster) Before(org.junit.Before)

Example 9 with NoopMaster

use of alluxio.master.NoopMaster in project alluxio by Alluxio.

the class UfsJournalCheckpointWriterTest method before.

@Before
public void before() throws Exception {
    URI location = URIUtils.appendPathOrDie(new URI(mFolder.newFolder().getAbsolutePath()), "FileSystemMaster");
    mUfs = Mockito.spy(UnderFileSystem.Factory.create(location.toString(), ServerConfiguration.global()));
    mJournal = new UfsJournal(location, new NoopMaster(), mUfs, 0, Collections::emptySet);
}
Also used : URI(java.net.URI) NoopMaster(alluxio.master.NoopMaster) Before(org.junit.Before)

Example 10 with NoopMaster

use of alluxio.master.NoopMaster in project alluxio by Alluxio.

the class UfsJournalReaderTest method before.

@Before
public void before() throws Exception {
    URI location = URIUtils.appendPathOrDie(new URI(mFolder.newFolder().getAbsolutePath()), "FileSystemMaster");
    mUfs = Mockito.spy(UnderFileSystem.Factory.create(location.toString(), ServerConfiguration.global()));
    mJournal = new UfsJournal(location, new NoopMaster(), mUfs, 0, Collections::emptySet);
    mJournal.start();
    mJournal.gainPrimacy();
}
Also used : URI(java.net.URI) NoopMaster(alluxio.master.NoopMaster) Before(org.junit.Before)

Aggregations

NoopMaster (alluxio.master.NoopMaster)22 Test (org.junit.Test)12 JournalContext (alluxio.master.journal.JournalContext)9 URI (java.net.URI)9 UfsJournal (alluxio.master.journal.ufs.UfsJournal)6 Collections (java.util.Collections)5 HashMap (java.util.HashMap)5 AlluxioURI (alluxio.AlluxioURI)4 CatchupFuture (alluxio.master.journal.CatchupFuture)4 Before (org.junit.Before)4 JournalReader (alluxio.master.journal.JournalReader)3 Journal (alluxio.proto.journal.Journal)2 BaseIntegrationTest (alluxio.testutils.BaseIntegrationTest)2 IOException (java.io.IOException)2 ExpectedException (org.junit.rules.ExpectedException)2 PropertyKey (alluxio.conf.PropertyKey)1 NoopUfsManager (alluxio.master.NoopUfsManager)1 JournalSystem (alluxio.master.journal.JournalSystem)1 CheckpointInputStream (alluxio.master.journal.checkpoint.CheckpointInputStream)1 UfsJournalReader (alluxio.master.journal.ufs.UfsJournalReader)1