Skip to content

Replace non-public TabletClosedException and ScanTimedOutException#3318

Open
SethSmucker wants to merge 6 commits intointegrationfrom
task/replace-nonpublic-exceptions
Open

Replace non-public TabletClosedException and ScanTimedOutException#3318
SethSmucker wants to merge 6 commits intointegrationfrom
task/replace-nonpublic-exceptions

Conversation

@SethSmucker
Copy link
Collaborator

Summary

  • Replace instanceof TabletClosedException with class name check
  • Replace catch (ScanTimedOutException) with class name check inside generic catch block

Files Changed

  • QueryIterator.java - TabletClosedException
  • DocIdQueryIterator.java - TabletClosedException
  • DocumentIterator.java - TabletClosedException
  • Scan.java - ScanTimedOutException

Approach

Since these are non-public Accumulo classes that won't exist in Accumulo 4, we use class name comparison:

private static boolean isTabletClosedException(Throwable t) {
    return t != null && t.getClass().getName().equals(
        "org.apache.accumulo.tserver.tablet.TabletClosedException");
}

Fixes #3317
Part of #2443

Replace instanceof checks for non-public Accumulo exceptions with
class name string comparison for Accumulo 4 compatibility:

- TabletClosedException in QueryIterator, DocIdQueryIterator, DocumentIterator
- ScanTimedOutException in Scan

Fixes #3317
Part of #2443
if (isScanTimedOutException(e)) {
// this is okay. This means that we are being timesliced.
myScan.addRange(currentRange);
return this;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be returning this here? Just curious because it was not in the original catch block you removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace non-public TabletClosedException and ScanTimedOutException

2 participants

Comments