@Override public boolean isFormatted(String journalId, String nameServiceId) throws IOException { return jn.getOrCreateJournal(journalId, nameServiceId).isFormatted(); }
private void checkFormatted() throws JournalNotFormattedException { if (!isFormatted()) { throw new JournalNotFormattedException("Journal " + storage.getSingularStorageDir() + " not formatted" + " ; journal id: " + journalId); } }
for (Map.Entry<String, Journal> entry : journalsById.entrySet()) { Map<String, String> jMap = new HashMap<String, String>(); jMap.put("Formatted", Boolean.toString(entry.getValue().isFormatted())); status.put(entry.getKey(), jMap);
private void startSyncJournalsDaemon() { syncJournalDaemon = new Daemon(() -> { while(!journal.isFormatted()) { try { Thread.sleep(journalSyncInterval); if (!journal.isFormatted()) { LOG.warn("Journal cannot sync. Not formatted."); } else {
@Override public boolean isFormatted(String journalId) throws IOException { return jn.getOrCreateJournal(journalId).isFormatted(); }
@Override public boolean isFormatted(String journalId) throws IOException { return jn.getOrCreateJournal(journalId).isFormatted(); }
private void checkFormatted() throws JournalNotFormattedException { if (!isFormatted()) { throw new JournalNotFormattedException("Journal " + storage.getSingularStorageDir() + " not formatted"); } }
for (Map.Entry<String, Journal> entry : journalsById.entrySet()) { Map<String, String> jMap = new HashMap<String, String>(); jMap.put("Formatted", Boolean.toString(entry.getValue().isFormatted())); status.put(entry.getKey(), jMap);
for (Map.Entry<String, Journal> entry : journalsById.entrySet()) { Map<String, String> jMap = new HashMap<String, String>(); jMap.put("Formatted", Boolean.toString(entry.getValue().isFormatted())); status.put(entry.getKey(), jMap);
private void checkFormatted() throws JournalNotFormattedException { if (!isFormatted()) { throw new JournalNotFormattedException("Journal " + storage.getSingularStorageDir() + " not formatted"); } }
@Test (timeout = 10000) public void testFormatResetsCachedValues() throws Exception { journal.newEpoch(FAKE_NSINFO, 12345L); journal.startLogSegment(new RequestInfo(JID, 12345L, 1L, 0L), 1L, NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION); assertEquals(12345L, journal.getLastPromisedEpoch()); assertEquals(12345L, journal.getLastWriterEpoch()); assertTrue(journal.isFormatted()); // Close the journal in preparation for reformatting it. journal.close(); journal.format(FAKE_NSINFO_2); assertEquals(0, journal.getLastPromisedEpoch()); assertEquals(0, journal.getLastWriterEpoch()); assertTrue(journal.isFormatted()); }