Apache9 commented on a change in pull request #3617:
URL: https://github.com/apache/hbase/pull/3617#discussion_r694571511
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
##########
@@ -850,6 +877,7 @@ public void commitMergedRegion(final RegionInfo
mergedRegionInfo) throws IOExcep
throw new IOException("Unable to rename " + mergedRegionTmpDir + " to "
+ regionDir);
}
+ loadRegionFilesIntoStoreTracker(regionDir);
Review comment:
I think we should also get the file list from store file tracker instead
of listing?
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/storefiletracker/DefaultStoreFileTracker.java
##########
@@ -33,7 +33,7 @@
@InterfaceAudience.Private
class DefaultStoreFileTracker extends StoreFileTrackerBase {
- public DefaultStoreFileTracker(Configuration conf, TableName tableName,
boolean isPrimaryReplica,
+ public DefaultStoreFileTracker(Configuration conf, TableName tableName,
Boolean isPrimaryReplica,
Review comment:
Why this change?
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/storefiletracker/StoreFileTrackerFactory.java
##########
@@ -17,19 +17,34 @@
*/
package org.apache.hadoop.hbase.regionserver.storefiletracker;
+import static
org.apache.hadoop.hbase.regionserver.storefiletracker.StoreFileTracker.STORE_FILE_TRACKER;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.regionserver.StoreContext;
+import org.apache.hadoop.hbase.util.ReflectionUtils;
import org.apache.yetus.audience.InterfaceAudience;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Factory method for creating store file tracker.
*/
@InterfaceAudience.Private
public final class StoreFileTrackerFactory {
+ private static final Logger LOG =
LoggerFactory.getLogger(StoreFileTrackerFactory.class);
+
public static StoreFileTracker create(Configuration conf, TableName
tableName,
- boolean isPrimaryReplica, StoreContext ctx) {
- return new DefaultStoreFileTracker(conf, tableName, isPrimaryReplica, ctx);
+ boolean isPrimaryReplica, StoreContext ctx) {
+ String className = conf.get(STORE_FILE_TRACKER,
DefaultStoreFileTracker.class.getName());
+ try {
+ LOG.info("instantiating StoreFileTracker impl {}", className);
+ return ReflectionUtils.instantiateWithCustomCtor(className,
Review comment:
I think there is a method in ReflectionUtils where we do not need to
provide the parameter types, just the parameters?
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
##########
@@ -648,11 +651,35 @@ public Path commitDaughterRegion(final RegionInfo
regionInfo)
if (!rename(daughterTmpDir, regionDir)) {
throw new IOException("Unable to rename " + daughterTmpDir + " to " +
regionDir);
}
+ loadRegionFilesIntoStoreTracker(regionDir);
}
-
return regionDir;
}
+ private void loadRegionFilesIntoStoreTracker(Path regionDir) throws
IOException {
Review comment:
We need to use list here? I think when generating the store files when
splitting or merging, we should know the store file list?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]