You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Copilot (via GitHub)" <gi...@apache.org> on 2025/10/07 12:31:32 UTC
Re: [PR] HBASE-29598 Fix regionDir in clone snapshots wfw to clone all mob files rightly t… [hbase]
Copilot commented on code in PR #7309:
URL: https://github.com/apache/hbase/pull/7309#discussion_r2410467193
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/storefiletracker/StoreFileTrackerFactory.java:
##########
@@ -118,7 +119,15 @@ public static Class<? extends StoreFileTracker> getTrackerClass(String trackerNa
public static StoreFileTracker create(Configuration conf, boolean isPrimaryReplica,
StoreContext ctx) {
- Class<? extends StoreFileTracker> tracker = getTrackerClass(conf);
+ Class<? extends StoreFileTracker> tracker;
+ if (
+ ctx != null && ctx.getRegionInfo().getEncodedName()
+ .equals(MobUtils.getMobRegionInfo(ctx.getTableName()).getEncodedName())
+ ) {
Review Comment:
[nitpick] The nested method calls and multi-line condition check is hard to read. Consider extracting this MOB region check into a separate method like `isMobRegion(StoreContext ctx)` to improve readability and maintainability.
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/storefiletracker/StoreFileTrackerFactory.java:
##########
@@ -118,7 +119,15 @@ public static Class<? extends StoreFileTracker> getTrackerClass(String trackerNa
public static StoreFileTracker create(Configuration conf, boolean isPrimaryReplica,
StoreContext ctx) {
- Class<? extends StoreFileTracker> tracker = getTrackerClass(conf);
+ Class<? extends StoreFileTracker> tracker;
+ if (
+ ctx != null && ctx.getRegionInfo().getEncodedName()
+ .equals(MobUtils.getMobRegionInfo(ctx.getTableName()).getEncodedName())
Review Comment:
Potential NullPointerException if `ctx.getRegionInfo()` or `ctx.getTableName()` returns null. Add null checks for these nested method calls or ensure they cannot be null in this context.
```suggestion
ctx != null
&& ctx.getRegionInfo() != null
&& ctx.getTableName() != null
&& ctx.getRegionInfo().getEncodedName()
.equals(MobUtils.getMobRegionInfo(ctx.getTableName()).getEncodedName())
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org