Apache9 commented on a change in pull request #3749:
URL: https://github.com/apache/hbase/pull/3749#discussion_r732354419



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java
##########
@@ -540,21 +567,39 @@ private void restoreRegion(final RegionInfo regionInfo,
         HFileArchiver.archiveFamilyByFamilyDir(fs, conf, regionInfo, 
familyDir, family);
         fs.delete(familyDir, true);
       }
+
+      SnapshotStoreFileTracker tracker = (SnapshotStoreFileTracker)
+        StoreFileTrackerFactory.create(conf, true,
+          StoreContext.getBuilder().withFamilyStoreDirectoryPath(familyDir).
+            withRegionFileSystem(regionFS).build());
+
+      //simply reset list of tracked files with the matching files
+      // and the extra one present in the snapshot
+      tracker.getSourceTracker().setReferenceFiles(filesToTrack);

Review comment:
       OK. The old design choice to not introduce set method in 
StoreFileTracker is that, it is only used in migration, which should not be 
called in upper layer. Since now the upper layer needs to do operations like a 
set, then let's introduce a set method to StoreFileTracker to make the 
implementation cleaner.




-- 
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]


Reply via email to