use of alluxio.master.journal.ufs.UfsJournalSnapshot in project alluxio by Alluxio.
the class IntegrationTestUtils method waitForUfsJournalCheckpoint.
/**
* Waits for a checkpoint to be written in the specified master's journal.
*
* @param masterName the name of the master
* @param journalLocation the location of the journal
*/
public static void waitForUfsJournalCheckpoint(String masterName, URI journalLocation) throws TimeoutException, InterruptedException {
UfsJournal journal = new UfsJournal(URIUtils.appendPathOrDie(journalLocation, masterName), new NoopMaster(""), 0, Collections::emptySet);
CommonUtils.waitFor("checkpoint to be written", () -> {
UfsJournalSnapshot snapshot;
try {
snapshot = UfsJournalSnapshot.getSnapshot(journal);
} catch (IOException e) {
throw new RuntimeException(e);
}
return !snapshot.getCheckpoints().isEmpty();
});
}
Aggregations