public boolean isStoredEntryId(long entryId, int bookieIndex) { return schedule.hasEntry(entryId, bookieIndex); }
/** * Get the last stored entry id of the fragment in the given failed bookie. * * @param bookieIndex * the bookie index in the ensemble. * @return first stored entry id on the bookie. */ public Long getLastStoredEntryId(int bookieIndex) { long lastEntry = lastKnownEntryId; for (int i = 0; i < ensemble.size() && lastEntry >= firstEntryId; i++) { if (schedule.hasEntry(lastEntry, bookieIndex)) { return lastEntry; } else { lastEntry--; } } return LedgerHandle.INVALID_ENTRY_ID; }
/** * Get the first stored entry id of the fragment in the given failed bookies. * * @param bookieIndex * the bookie index in the ensemble. * @return first stored entry id on the bookie. */ public Long getFirstStoredEntryId(int bookieIndex) { long firstEntry = firstEntryId; for (int i = 0; i < ensemble.size() && firstEntry <= lastKnownEntryId; i++) { if (schedule.hasEntry(firstEntry, bookieIndex)) { return firstEntry; } else { firstEntry++; } } return LedgerHandle.INVALID_ENTRY_ID; }
if (distributionSchedule.hasEntry(firstEntryIter, thisBookieIndexInCurrentEnsemble)) { firstStoredEntryId = firstEntryIter; break;