HBASE-7453 HBASE-7423 snapshot followup (Matteo Bertozzi)
git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/hbase-7290@1445842 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9a6a2e87e2
commit
33d7976deb
@ -169,7 +169,7 @@ public class RestoreSnapshotHelper {
|
|||||||
|
|
||||||
// Remove regions from the current table
|
// Remove regions from the current table
|
||||||
monitor.rethrowException();
|
monitor.rethrowException();
|
||||||
ModifyRegionUtils.deleteRegions(fs, catalogTracker, regionsToRemove);
|
ModifyRegionUtils.deleteRegions(conf, fs, catalogTracker, regionsToRemove);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Regions to Add: present in the snapshot but not in the current table
|
// Regions to Add: present in the snapshot but not in the current table
|
||||||
|
@ -185,11 +185,11 @@ public abstract class ModifyRegionUtils {
|
|||||||
* @param catalogTracker the catalog tracker
|
* @param catalogTracker the catalog tracker
|
||||||
* @param regions list of {@link HRegionInfo} to delete.
|
* @param regions list of {@link HRegionInfo} to delete.
|
||||||
*/
|
*/
|
||||||
public static void deleteRegions(final FileSystem fs, final CatalogTracker catalogTracker,
|
public static void deleteRegions(final Configuration conf, final FileSystem fs,
|
||||||
final List<HRegionInfo> regions) throws IOException {
|
final CatalogTracker catalogTracker, final List<HRegionInfo> regions) throws IOException {
|
||||||
if (regions != null && regions.size() > 0) {
|
if (regions != null && regions.size() > 0) {
|
||||||
for (HRegionInfo hri: regions) {
|
for (HRegionInfo hri: regions) {
|
||||||
deleteRegion(fs, catalogTracker, hri);
|
deleteRegion(conf, fs, catalogTracker, hri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -202,12 +202,12 @@ public abstract class ModifyRegionUtils {
|
|||||||
* @param catalogTracker the catalog tracker
|
* @param catalogTracker the catalog tracker
|
||||||
* @param regionInfo {@link HRegionInfo} to delete.
|
* @param regionInfo {@link HRegionInfo} to delete.
|
||||||
*/
|
*/
|
||||||
public static void deleteRegion(final FileSystem fs, final CatalogTracker catalogTracker,
|
public static void deleteRegion(final Configuration conf, final FileSystem fs,
|
||||||
final HRegionInfo regionInfo) throws IOException {
|
final CatalogTracker catalogTracker, final HRegionInfo regionInfo) throws IOException {
|
||||||
// Remove region from .META.
|
// Remove region from .META.
|
||||||
MetaEditor.deleteRegion(catalogTracker, regionInfo);
|
MetaEditor.deleteRegion(catalogTracker, regionInfo);
|
||||||
|
|
||||||
// "Delete" region from FS
|
// "Delete" region from FS
|
||||||
HFileArchiver.archiveRegion(fs, regionInfo);
|
HFileArchiver.archiveRegion(conf, fs, regionInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user