diff --git a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/cache/RangeEntryCacheImpl.java b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/cache/RangeEntryCacheImpl.java index 163728e0f0429..e07bb7899ee4b 100644 --- a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/cache/RangeEntryCacheImpl.java +++ b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/cache/RangeEntryCacheImpl.java @@ -201,20 +201,6 @@ public void invalidateAllEntries(long ledgerId) { @Override public void asyncReadEntry(ReadHandle lh, PositionImpl position, final ReadEntryCallback callback, final Object ctx) { - try { - asyncReadEntry0(lh, position, callback, ctx); - } catch (Throwable t) { - log.warn("failed to read entries for {}-{}", lh.getId(), position, t); - // invalidate all entries related to ledger from the cache (it might happen if entry gets corrupt - // (entry.data is already deallocate due to any race-condition) so, invalidate cache and next time read from - // the bookie) - invalidateAllEntries(lh.getId()); - callback.readEntryFailed(createManagedLedgerException(t), ctx); - } - } - - private void asyncReadEntry0(ReadHandle lh, PositionImpl position, final ReadEntryCallback callback, - final Object ctx) { if (log.isDebugEnabled()) { log.debug("[{}] Reading entry ledger {}: {}", ml.getName(), lh.getId(), position.getEntryId()); } @@ -254,22 +240,8 @@ private void asyncReadEntry0(ReadHandle lh, PositionImpl position, final ReadEnt } @Override - public void asyncReadEntry(ReadHandle lh, long firstEntry, long lastEntry, boolean shouldCacheEntry, - final ReadEntriesCallback callback, Object ctx) { - try { - asyncReadEntry0(lh, firstEntry, lastEntry, shouldCacheEntry, callback, ctx); - } catch (Throwable t) { - log.warn("failed to read entries for {}--{}-{}", lh.getId(), firstEntry, lastEntry, t); - // invalidate all entries related to ledger from the cache (it might happen if entry gets corrupt - // (entry.data is already deallocate due to any race-condition) so, invalidate cache and next time read from - // the bookie) - invalidateAllEntries(lh.getId()); - callback.readEntriesFailed(createManagedLedgerException(t), ctx); - } - } - @SuppressWarnings({ "unchecked", "rawtypes" }) - void asyncReadEntry0(ReadHandle lh, long firstEntry, long lastEntry, boolean shouldCacheEntry, + public void asyncReadEntry(ReadHandle lh, long firstEntry, long lastEntry, boolean shouldCacheEntry, final ReadEntriesCallback callback, Object ctx) { final long ledgerId = lh.getId(); final int entriesToRead = (int) (lastEntry - firstEntry) + 1;