Skip to content

Commit 45287f1

Browse files
author
Prathyusha Garre
committed
HBASE-29346 Use rootDir, tableDir instance vars of RestoreSnapshotHelper while removeHDFSRegions of restore
1 parent ae5400e commit 45287f1

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/backup/HFileArchiver.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,17 @@ public static void archiveRegion(Configuration conf, FileSystem fs, RegionInfo i
105105
FSUtils.getRegionDirFromRootDir(rootDir, info));
106106
}
107107

108+
/**
109+
* Cleans up all the files for a HRegion by archiving the HFiles to the archive directory
110+
* @param conf the configuration to use
111+
* @param fs the file system object
112+
* @param info RegionInfo for region to be deleted
113+
*/
114+
public static void archiveRegion(Configuration conf, FileSystem fs, RegionInfo info, Path rootDir,
115+
Path tableDir) throws IOException {
116+
archiveRegion(conf, fs, rootDir, tableDir, FSUtils.getRegionDirFromRootDir(rootDir, info));
117+
}
118+
108119
/**
109120
* Remove an entire region from the table directory via archiving the region's hfiles.
110121
* @param fs {@link FileSystem} from which to remove the region

hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/RestoreSnapshotHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ private void removeHdfsRegions(final ThreadPoolExecutor exec, final List<RegionI
413413
ModifyRegionUtils.editRegions(exec, regions, new ModifyRegionUtils.RegionEditTask() {
414414
@Override
415415
public void editRegion(final RegionInfo hri) throws IOException {
416-
HFileArchiver.archiveRegion(conf, fs, hri);
416+
HFileArchiver.archiveRegion(conf, fs, hri, rootDir, tableDir);
417417
}
418418
});
419419
}

0 commit comments

Comments
 (0)