@Override protected int runCmd() throws Exception { LedgerHandle lh = getBookKeeperClient().get().openLedgerNoRecovery( getLedgerID(), BookKeeper.DigestType.CRC32, dlConf.getBKDigestPW().getBytes(UTF_8)); try { long lac = lh.readLastConfirmed(); System.out.println("LastAddConfirmed: " + lac); } finally { lh.close(); } return 0; }
dlConf.getBKDigestPW().getBytes(UTF_8)); try { long lac = lh.readLastConfirmed(); segment = segment.mutator().setLastEntryId(lac).build(); if (printInprogressOnly && dumpEntries && lac >= 0) {
@Override protected int runCmd() throws Exception { LedgerHandle lh = getBookKeeperClient().get().openLedgerNoRecovery(getLedgerID(), BookKeeper.DigestType.CRC32, dlConf.getBKDigestPW().getBytes(UTF_8)); try { if (null == fromEntryId) { fromEntryId = 0L; } if (null == untilEntryId) { untilEntryId = lh.readLastConfirmed(); } if (untilEntryId >= fromEntryId) { if (readAllBookies) { LedgerReader lr = new LedgerReader(getBookKeeperClient().get()); if (readLac) { readLacsFromAllBookies(lr, lh, fromEntryId, untilEntryId); } else { readEntriesFromAllBookies(lr, lh, fromEntryId, untilEntryId); } } else { simpleReadEntries(lh, fromEntryId, untilEntryId); } } else { System.out.println("No entries."); } } finally { lh.close(); } return 0; }
private void checkAndWaitWriterReaderPosition(BKLogSegmentWriter writer, long expectedWriterPosition, BKAsyncLogReaderDLSN reader, long expectedReaderPosition, LedgerHandle inspector, long expectedLac) throws Exception { while (getLedgerHandle(writer).getLastAddConfirmed() < expectedWriterPosition) { Thread.sleep(1000); } assertEquals(expectedWriterPosition, getLedgerHandle(writer).getLastAddConfirmed()); assertEquals(expectedLac, inspector.readLastConfirmed()); LedgerReadPosition readPosition = reader.bkLedgerManager.readAheadWorker.getNextReadAheadPosition(); logger.info("ReadAhead moved read position {} : ", readPosition); while (readPosition.getEntryId() < expectedReaderPosition) { Thread.sleep(1000); readPosition = reader.bkLedgerManager.readAheadWorker.getNextReadAheadPosition(); logger.info("ReadAhead moved read position {} : ", readPosition); } assertEquals(expectedReaderPosition, readPosition.getEntryId()); }
@Override protected int runCmd() throws Exception { LedgerHandle lh = getBookKeeperClient().get().openLedgerNoRecovery( getLedgerID(), BookKeeper.DigestType.CRC32, dlConf.getBKDigestPW().getBytes(UTF_8)); try { long lac = lh.readLastConfirmed(); System.out.println("LastAddConfirmed: " + lac); } finally { lh.close(); } return 0; }
BookKeeper.DigestType.CRC32, dlConf.getBKDigestPW().getBytes(UTF_8)); try { long lac = lh.readLastConfirmed(); segment = segment.mutator().setLastEntryId(lac).build(); if (printInprogressOnly && dumpEntries && lac >= 0) {
untilEntryId = lh.readLastConfirmed();