Index: src/main/java/org/apache/hadoop/hbase/util/FSUtils.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/util/FSUtils.java (wersja 1164353) +++ src/main/java/org/apache/hadoop/hbase/util/FSUtils.java (kopia robocza) @@ -490,6 +490,19 @@ return fs.exists(rootRegionDir); } + /** + * Checks if .tableinfo exists for root region + * + * @param fs file system + * @param rootdir root directory of HBase installation + * @return true if exists + * @throws IOException + */ + public static boolean tableInfoExists(FileSystem fs, Path rootdir, String table) + throws IOException { + Path tablePath = getTableInfoPath(rootdir, table); + return fs.exists(tablePath); + } /** * Compute HDFS blocks distribution of a given file, or a portion of the file Index: src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java (wersja 1164353) +++ src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java (kopia robocza) @@ -324,6 +324,22 @@ if (!FSUtils.rootRegionExists(fs, rd)) { bootstrap(rd, c); } + // Create META and ROOT tableInfo if required. + if (!FSUtils.tableInfoExists(fs, rd, "-ROOT-")) { + LOG.info("Creating HTableDescriptor for ROOT tables"); + FSUtils.createTableDescriptor(HTableDescriptor.ROOT_TABLEDESC, this.conf); + } else { + LOG.warn("FSUtils.rootTableInfoExists says that ROOT have HTableDescriptor"); + } + + if (!FSUtils.tableInfoExists(fs, rd, ".META.")) { + LOG.info("Creating HTableDescriptor for .META. tables"); + FSUtils.createTableDescriptor(HTableDescriptor.META_TABLEDESC, this.conf); + } else { + LOG.warn("FSUtils.rootTableInfoExists says that META have HTableDescriptor"); + } + + return rd; }