Skip to content

Commit

Permalink
HBASE-28332 Type conversion is no need in method CompactionChecker.ch…
Browse files Browse the repository at this point in the history
…ore() (#5653)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
  • Loading branch information
guluo2016 authored Jan 26, 2024
1 parent 73cb0dd commit addb4e7
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1684,14 +1684,13 @@ private static class CompactionChecker extends ScheduledChore {

@Override
protected void chore() {
for (Region r : this.instance.onlineRegions.values()) {
for (HRegion hr : this.instance.onlineRegions.values()) {
// If region is read only or compaction is disabled at table level, there's no need to
// iterate through region's stores
if (r == null || r.isReadOnly() || !r.getTableDescriptor().isCompactionEnabled()) {
if (hr == null || hr.isReadOnly() || !hr.getTableDescriptor().isCompactionEnabled()) {
continue;
}

HRegion hr = (HRegion) r;
for (HStore s : hr.stores.values()) {
try {
long multiplier = s.getCompactionCheckMultiplier();
Expand Down Expand Up @@ -1719,7 +1718,7 @@ protected void chore() {
}
}
} catch (IOException e) {
LOG.warn("Failed major compaction check on " + r, e);
LOG.warn("Failed major compaction check on " + hr, e);
}
}
}
Expand Down

0 comments on commit addb4e7

Please sign in to comment.