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 conf)
           
 
Method Summary
static void main(String[] args)
          Main program
 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 conf)
Parameters:
conf -
Method Detail

run

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

main

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

Parameters:
args - command line arguments


Copyright © 2008 The Apache Software Foundation