public class NamespaceUpgrade extends Object implements org.apache.hadoop.util.Tool
The pre-0.96 paths and dir names are hardcoded in here.
| Modifier and Type | Field and Description | 
|---|---|
private org.apache.hadoop.fs.Path | 
backupDir  | 
private org.apache.hadoop.fs.Path[] | 
baseDirs  | 
private org.apache.hadoop.conf.Configuration | 
conf  | 
private org.apache.hadoop.fs.Path | 
defNsDir  | 
private static String | 
DOT_ARCHIVE  | 
private static String | 
DOT_CORRUPT  | 
private static String | 
DOT_LIB_DIR  | 
private static String | 
DOT_LOGS  | 
private static String | 
DOT_OLD_LOGS  | 
private static String | 
DOT_SPLITLOG  | 
private org.apache.hadoop.fs.FileSystem | 
fs  | 
private static org.apache.commons.logging.Log | 
LOG  | 
(package private) static List<String> | 
NON_USER_TABLE_DIRS
Directories that are not HBase table directories 
 | 
private static String | 
OLD_ACL  | 
private org.apache.hadoop.fs.Path | 
rootDir  | 
private org.apache.hadoop.fs.Path | 
sysNsDir  | 
(package private) static Comparator<org.apache.hadoop.fs.FileStatus> | 
TABLEINFO_FILESTATUS_COMPARATOR  | 
private static org.apache.hadoop.fs.PathFilter | 
TABLEINFO_PATHFILTER  | 
private static String | 
TMP_DATA_DIR  | 
| Constructor and Description | 
|---|
NamespaceUpgrade()  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
deleteRoot()
Remove the -ROOT- dir. 
 | 
org.apache.hadoop.conf.Configuration | 
getConf()  | 
(package private) static org.apache.hadoop.fs.FileStatus | 
getCurrentTableInfoStatus(org.apache.hadoop.fs.FileSystem fs,
                         org.apache.hadoop.fs.Path dir)  | 
void | 
init()  | 
void | 
makeNamespaceDirs()
Create the system and default namespaces dirs 
 | 
void | 
migrateACL()  | 
void | 
migrateDotDirs()
Rename all the dot dirs -- .data, .archive, etc. 
 | 
void | 
migrateMeta()  | 
void | 
migrateSnapshots()  | 
void | 
migrateTables()
Migrate all tables into respective namespaces, either default or system. 
 | 
private void | 
mkdirs(org.apache.hadoop.fs.Path p)  | 
private static HTableDescriptor | 
readTableDescriptor(org.apache.hadoop.fs.FileSystem fs,
                   org.apache.hadoop.fs.FileStatus status)  | 
private void | 
removeTableInfoInPre96Format(TableName tableName)
Removes .tableinfo files that are laid in pre-96 format (i.e., the tableinfo files are under
 table directory). 
 | 
private void | 
rename(org.apache.hadoop.fs.Path src,
      org.apache.hadoop.fs.Path tgt)  | 
int | 
run(String[] args)  | 
void | 
setConf(org.apache.hadoop.conf.Configuration conf)  | 
(package private) void | 
updateAcls(HRegion region)
Deletes the old _acl_ entry, and inserts a new one using namespace. 
 | 
void | 
upgradeTableDirs()  | 
static boolean | 
verifyNSUpgrade(org.apache.hadoop.fs.FileSystem fs,
               org.apache.hadoop.fs.Path rootDir)  | 
private static final org.apache.commons.logging.Log LOG
private org.apache.hadoop.conf.Configuration conf
private org.apache.hadoop.fs.FileSystem fs
private org.apache.hadoop.fs.Path rootDir
private org.apache.hadoop.fs.Path sysNsDir
private org.apache.hadoop.fs.Path defNsDir
private org.apache.hadoop.fs.Path[] baseDirs
private org.apache.hadoop.fs.Path backupDir
private static final String TMP_DATA_DIR
private static final String DOT_LOGS
private static final String DOT_OLD_LOGS
private static final String DOT_CORRUPT
private static final String DOT_SPLITLOG
private static final String DOT_ARCHIVE
private static final String DOT_LIB_DIR
private static final String OLD_ACL
static final List<String> NON_USER_TABLE_DIRS
private static final org.apache.hadoop.fs.PathFilter TABLEINFO_PATHFILTER
static final Comparator<org.apache.hadoop.fs.FileStatus> TABLEINFO_FILESTATUS_COMPARATOR
public NamespaceUpgrade()
                 throws IOException
IOExceptionpublic void init()
          throws IOException
IOExceptionpublic void upgradeTableDirs()
                      throws IOException,
                             DeserializationException
IOExceptionDeserializationExceptionpublic void deleteRoot()
                throws IOException
IOExceptionpublic void migrateDotDirs()
                    throws IOException
IOExceptionprivate void mkdirs(org.apache.hadoop.fs.Path p)
             throws IOException
IOExceptionprivate void rename(org.apache.hadoop.fs.Path src,
          org.apache.hadoop.fs.Path tgt)
             throws IOException
IOExceptionpublic void makeNamespaceDirs()
                       throws IOException
IOExceptionpublic void migrateTables()
                   throws IOException
IOExceptionpublic void migrateSnapshots()
                      throws IOException
IOExceptionpublic void migrateMeta()
                 throws IOException
IOExceptionprivate void removeTableInfoInPre96Format(TableName tableName) throws IOException
tableName - IOExceptionpublic void migrateACL()
                throws IOException
IOExceptionvoid updateAcls(HRegion region) throws IOException
region - IOExceptionprivate static HTableDescriptor readTableDescriptor(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.FileStatus status) throws IOException
IOExceptionstatic org.apache.hadoop.fs.FileStatus getCurrentTableInfoStatus(org.apache.hadoop.fs.FileSystem fs,
                                                        org.apache.hadoop.fs.Path dir)
                                                          throws IOException
IOExceptionpublic static boolean verifyNSUpgrade(org.apache.hadoop.fs.FileSystem fs,
                      org.apache.hadoop.fs.Path rootDir)
                               throws IOException
IOExceptionpublic int run(String[] args) throws Exception
run in interface org.apache.hadoop.util.ToolExceptionpublic void setConf(org.apache.hadoop.conf.Configuration conf)
setConf in interface org.apache.hadoop.conf.Configurablepublic org.apache.hadoop.conf.Configuration getConf()
getConf in interface org.apache.hadoop.conf.ConfigurableCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.