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:
Michael Stack 2009-07-16 05:27:25 +00:00
parent 525d1f985d
commit 64311a2922
2 changed files with 26 additions and 5 deletions

View File

@ -217,13 +217,26 @@ public class Migrate extends Configured implements Tool {
Path hbaseRootDir = new Path(conf.get(HConstants.HBASE_DIR));
boolean pre020 = FSUtils.isPre020FileLayout(fs, hbaseRootDir);
if (pre020) {
LOG.info("Checking pre020 filesystem is major compacted");
if (!FSUtils.isMajorCompactedPre020(fs, hbaseRootDir)) {
String msg = "All tables must be major compacted before migration." +
MIGRATION_LINK;
System.out.println(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.
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.
* @param mr

View File

@ -61,7 +61,6 @@ public class MigrationTest extends HBaseTestCase {
FileSystem fs = FileSystem.get(this.conf);
Path hbasedir = loadTestData(fs, rootdir);
assertTrue(fs.exists(hbasedir));
listPaths(fs, hbasedir, -1);
Migrate migrator = new Migrate(this.conf);
Path qualified = fs.makeQualified(hbasedir);
String uri = qualified.toString();