org.apache.hadoop.hbase.migration
Class NamespaceUpgrade

java.lang.Object
  extended by org.apache.hadoop.hbase.migration.NamespaceUpgrade
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable, org.apache.hadoop.util.Tool

public class NamespaceUpgrade
extends Object
implements org.apache.hadoop.util.Tool

Upgrades old 0.94 filesystem layout to namespace layout Does the following: - creates system namespace directory and move .META. table there renaming .META. table to hbase:meta, this in turn would require to re-encode the region directory name

The pre-0.96 paths and dir names are hardcoded in here.


Constructor Summary
NamespaceUpgrade()
           
 
Method Summary
 void deleteRoot()
          Remove the -ROOT- dir.
 org.apache.hadoop.conf.Configuration getConf()
           
 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.
 int run(String[] args)
           
 void setConf(org.apache.hadoop.conf.Configuration conf)
           
 void upgradeTableDirs()
           
static boolean verifyNSUpgrade(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootDir)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamespaceUpgrade

public NamespaceUpgrade()
                 throws IOException
Throws:
IOException
Method Detail

init

public void init()
          throws IOException
Throws:
IOException

upgradeTableDirs

public void upgradeTableDirs()
                      throws IOException,
                             DeserializationException
Throws:
IOException
DeserializationException

deleteRoot

public void deleteRoot()
                throws IOException
Remove the -ROOT- dir. No longer of use.

Throws:
IOException

migrateDotDirs

public void migrateDotDirs()
                    throws IOException
Rename all the dot dirs -- .data, .archive, etc. -- as data, archive, etc.; i.e. minus the dot.

Throws:
IOException

makeNamespaceDirs

public void makeNamespaceDirs()
                       throws IOException
Create the system and default namespaces dirs

Throws:
IOException

migrateTables

public void migrateTables()
                   throws IOException
Migrate all tables into respective namespaces, either default or system. We put them into a temporary location, '.data', in case a user table is name 'data'. In a later method we will move stuff from .data to data.

Throws:
IOException

migrateSnapshots

public void migrateSnapshots()
                      throws IOException
Throws:
IOException

migrateMeta

public void migrateMeta()
                 throws IOException
Throws:
IOException

migrateACL

public void migrateACL()
                throws IOException
Throws:
IOException

verifyNSUpgrade

public static boolean verifyNSUpgrade(org.apache.hadoop.fs.FileSystem fs,
                                      org.apache.hadoop.fs.Path rootDir)
                               throws IOException
Throws:
IOException

run

public int run(String[] args)
        throws Exception
Specified by:
run in interface org.apache.hadoop.util.Tool
Throws:
Exception

setConf

public void setConf(org.apache.hadoop.conf.Configuration conf)
Specified by:
setConf in interface org.apache.hadoop.conf.Configurable

getConf

public org.apache.hadoop.conf.Configuration getConf()
Specified by:
getConf in interface org.apache.hadoop.conf.Configurable


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.