org.apache.hadoop.hbase.util
Class Migrate

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

public class Migrate
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.util.Tool

Perform a migration. HBase keeps a file in hdfs named hbase.version just under the hbase.rootdir. This file holds the version of the hbase data in the Filesystem. When the software changes in a manner incompatible with the data in the Filesystem, it updates its internal version number, HConstants.FILE_SYSTEM_VERSION. This wrapper script manages moving the filesystem across versions until there's a match with current software's version number. This script will only cross a particular version divide. You may need to install earlier or later hbase to migrate earlier (or older) versions.

This wrapper script comprises a set of migration steps. Which steps are run depends on the span between the version of the hbase data in the Filesystem and the version of the current softare.

A migration script must accompany any patch that changes data formats.

This script has a 'check' and 'execute' mode. Adding migration steps, its important to keep this in mind. Testing if migration needs to be run, be careful not to make presumptions about the current state of the data in the filesystem. It may have a format from many versions previous with layout not as expected or keys and values of a format not expected. Tools such as MetaUtils may not work as expected when running against old formats -- or, worse, fail in ways that are hard to figure (One such is edits made by previous migration steps not being apparent in later migration steps). The upshot is always verify presumptions migrating.

This script will migrate an hbase 0.18.x only.

See Also:
How To Migration

Constructor Summary
Migrate()
          Default constructor.
Migrate(HBaseConfiguration c)
           
 
Method Summary
static void main(String[] args)
          Main program
static void rewrite(HBaseConfiguration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path mf)
          Rewrite the passed 0.19 mapfile as a 0.20 file.
 int run(String[] args)
           
 
Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
 

Constructor Detail

Migrate

public Migrate()
Default constructor.


Migrate

public Migrate(HBaseConfiguration c)
Parameters:
c -
Method Detail

run

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

rewrite

public static void rewrite(HBaseConfiguration conf,
                           org.apache.hadoop.fs.FileSystem fs,
                           org.apache.hadoop.fs.Path mf)
                    throws IOException
Rewrite the passed 0.19 mapfile as a 0.20 file.

Parameters:
fs -
mf -
Throws:
IOExcepion
IOException

main

public static void main(String[] args)
Main program

Parameters:
args - command line arguments


Copyright © 2009 The Apache Software Foundation