HBASE-1215 allow that file rewrite may have happened before migration -- likely the case when data is big
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@794535 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
525d1f985d
commit
64311a2922
@ -217,13 +217,26 @@ public class Migrate extends Configured implements Tool {
|
|||||||
Path hbaseRootDir = new Path(conf.get(HConstants.HBASE_DIR));
|
Path hbaseRootDir = new Path(conf.get(HConstants.HBASE_DIR));
|
||||||
boolean pre020 = FSUtils.isPre020FileLayout(fs, hbaseRootDir);
|
boolean pre020 = FSUtils.isPre020FileLayout(fs, hbaseRootDir);
|
||||||
if (pre020) {
|
if (pre020) {
|
||||||
|
LOG.info("Checking pre020 filesystem is major compacted");
|
||||||
if (!FSUtils.isMajorCompactedPre020(fs, hbaseRootDir)) {
|
if (!FSUtils.isMajorCompactedPre020(fs, hbaseRootDir)) {
|
||||||
String msg = "All tables must be major compacted before migration." +
|
String msg = "All tables must be major compacted before migration." +
|
||||||
MIGRATION_LINK;
|
MIGRATION_LINK;
|
||||||
System.out.println(msg);
|
System.out.println(msg);
|
||||||
throw new IOException(msg);
|
throw new IOException(msg);
|
||||||
}
|
}
|
||||||
// TODO: Rewrite regions.
|
rewrite(fs, hbaseRootDir);
|
||||||
|
}
|
||||||
|
LOG.info("Checking filesystem is major compacted");
|
||||||
|
// Below check is good for both making sure that we are major compacted
|
||||||
|
// but will also fail if not all dirs were rewritten.
|
||||||
|
if (!FSUtils.isMajorCompacted(fs, hbaseRootDir)) {
|
||||||
|
LOG.info("Checking filesystem is major compacted");
|
||||||
|
if (!FSUtils.isMajorCompacted(fs, hbaseRootDir)) {
|
||||||
|
String msg = "All tables must be major compacted before migration." +
|
||||||
|
MIGRATION_LINK;
|
||||||
|
System.out.println(msg);
|
||||||
|
throw new IOException(msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// TOOD: Verify all has been brought over from old to new layout.
|
// TOOD: Verify all has been brought over from old to new layout.
|
||||||
final MetaUtils utils = new MetaUtils(this.conf);
|
final MetaUtils utils = new MetaUtils(this.conf);
|
||||||
@ -270,6 +283,15 @@ set to control the master's address (not mandatory).
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Rewrite all under hbase root dir.
|
||||||
|
* @param fs
|
||||||
|
* @param hbaseRootDir
|
||||||
|
*/
|
||||||
|
private void rewrite(final FileSystem fs, final Path hbaseRootDir) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Enable blockcaching on catalog tables.
|
* Enable blockcaching on catalog tables.
|
||||||
* @param mr
|
* @param mr
|
||||||
|
@ -61,7 +61,6 @@ public class MigrationTest extends HBaseTestCase {
|
|||||||
FileSystem fs = FileSystem.get(this.conf);
|
FileSystem fs = FileSystem.get(this.conf);
|
||||||
Path hbasedir = loadTestData(fs, rootdir);
|
Path hbasedir = loadTestData(fs, rootdir);
|
||||||
assertTrue(fs.exists(hbasedir));
|
assertTrue(fs.exists(hbasedir));
|
||||||
listPaths(fs, hbasedir, -1);
|
|
||||||
Migrate migrator = new Migrate(this.conf);
|
Migrate migrator = new Migrate(this.conf);
|
||||||
Path qualified = fs.makeQualified(hbasedir);
|
Path qualified = fs.makeQualified(hbasedir);
|
||||||
String uri = qualified.toString();
|
String uri = qualified.toString();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user