Skip to content

Commit 6de25b8

Browse files
author
sairampola
committed
Refactor AbstractMultiTenantReader to remove unnecessary scannerClosed flag and streamline the close method. Update MultiTenantHFileWriter to catch and rethrow exceptions as IOException for improved error handling during section closure.
1 parent 997c7a5 commit 6de25b8

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/AbstractMultiTenantReader.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,11 +1711,8 @@ public ExtendedCell getNextIndexedKey() {
17111711
return currentScanner.getNextIndexedKey();
17121712
}
17131713

1714-
private boolean scannerClosed = false;
1715-
17161714
@Override
17171715
public void close() {
1718-
scannerClosed = true;
17191716
try {
17201717
if (currentScanner != null) {
17211718
currentScanner.close();

hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/MultiTenantHFileWriter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,13 +718,13 @@ private void createNewSection(byte[] tenantSectionId, byte[] tenantId) throws IO
718718
if (customTieringSupplier != null) {
719719
newSection.setTimeRangeTrackerForTiering(customTieringSupplier);
720720
}
721-
} catch (Exception e) {
721+
} catch (RuntimeException e) {
722722
try {
723723
newSection.close();
724724
} catch (IOException closeEx) {
725725
e.addSuppressed(closeEx);
726726
}
727-
throw e instanceof IOException ? (IOException) e : new IOException(e);
727+
throw new IOException(e);
728728
}
729729
currentSectionWriter = newSection;
730730

0 commit comments

Comments
 (0)