wchevreuil commented on a change in pull request #3617:
URL: https://github.com/apache/hbase/pull/3617#discussion_r697756455
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
##########
@@ -592,19 +597,41 @@ void cleanupDaughterRegion(final RegionInfo regionInfo)
throws IOException {
* @param regionInfo daughter {@link
org.apache.hadoop.hbase.client.RegionInfo}
* @throws IOException
*/
- public Path commitDaughterRegion(final RegionInfo regionInfo)
+ public Path commitDaughterRegion(final RegionInfo regionInfo, List<Path>
allRegionFiles)
throws IOException {
Path regionDir = this.getSplitsDir(regionInfo);
if (fs.exists(regionDir)) {
// Write HRI to a file in case we need to recover hbase:meta
Path regionInfoFile = new Path(regionDir, REGION_INFO_FILE);
byte[] regionInfoContent = getRegionInfoFileContent(regionInfo);
writeRegionInfoFileContent(conf, fs, regionInfoFile, regionInfoContent);
+ loadRegionFilesIntoStoreTracker(allRegionFiles);
}
-
return regionDir;
}
+ private void loadRegionFilesIntoStoreTracker(List<Path> allFiles) throws
IOException {
+ //we need to map trackers per store
+ Map<String, StoreFileTracker> trackerMap = new HashMap<>();
+ //we need to map store files per store
+ Map<String, List<StoreFileInfo>> fileInfoMap = new HashMap<>();
+ for(Path file : allFiles) {
+ String familyName = file.getParent().getName();
+ trackerMap.computeIfAbsent(familyName, t -> {
+ ColumnFamilyDescriptorBuilder fDescBuilder =
+ ColumnFamilyDescriptorBuilder.newBuilder(Bytes.toBytes(familyName));
+ return StoreFileTrackerFactory.create(conf, regionInfo.getTable(),
true,
Review comment:
Agreed. Had changed this on latest commit.
--
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]