nextReadAheadPosition.advance(); LedgerEntry e = seq.nextElement(); LedgerReadPosition readPosition = new LedgerReadPosition(e.getLedgerId(), currentMetadata.getLogSegmentSequenceNumber(), e.getEntryId()); readAheadCache.set(readPosition, e, null != ctx ? ctx.toString() : "", currentMetadata.getEnvelopeEntries(), currentMetadata.getStartSequenceId());
&& (nextReadAheadPosition.getLedgerId() == entry.getLedgerId())) { if (lastConfirmed <= 4 && conf.getTraceReadAheadMetadataChanges()) { LOG.info("Hit readLastConfirmedAndEntry for {} at {} : entry = {}, lac = {}, position = {}.", readAheadCache.set(new LedgerReadPosition(entry.getLedgerId(), currentLH.getLogSegmentSequenceNo(), entry.getEntryId()), entry, null != ctx ? ctx.toString() : "", currentMetadata.getEnvelopeEntries(), currentMetadata.getStartSequenceId());
public static EntryImpl create(LedgerEntry ledgerEntry) { EntryImpl entry = RECYCLER.get(); entry.ledgerId = ledgerEntry.getLedgerId(); entry.entryId = ledgerEntry.getEntryId(); entry.data = ledgerEntry.getEntryBuffer(); entry.data.retain(); entry.setRefCnt(1); return entry; }
/** * Format the entry into a readable format. * * @param entry * ledgerentry to print * @param printMsg * Whether printing the message body */ private void formatEntry(LedgerEntry entry, boolean printMsg) { long ledgerId = entry.getLedgerId(); long entryId = entry.getEntryId(); long entrySize = entry.getLength(); System.out.println("--------- Lid=" + ledgerIdFormatter.formatLedgerId(ledgerId) + ", Eid=" + entryId + ", EntrySize=" + entrySize + " ---------"); if (printMsg) { entryFormatter.formatEntry(entry.getEntry()); } }
public static LastConfirmedAndEntryImpl create(long lac, org.apache.bookkeeper.client.LedgerEntry entry) { LastConfirmedAndEntryImpl entryImpl = RECYCLER.get(); entryImpl.lac = lac; if (null == entry) { entryImpl.entry = null; } else { entryImpl.entry = LedgerEntryImpl.create( entry.getLedgerId(), entry.getEntryId(), entry.getLength(), entry.getEntryBuffer()); } return entryImpl; }