org.apache.hadoop.hbase.mapreduce
Class IndexBuilder

java.lang.Object
  extended by org.apache.hadoop.hbase.mapreduce.IndexBuilder

public class IndexBuilder
extends Object

Example map/reduce job to construct index tables that can be used to quickly find a row based on the value of a column. It demonstrates:

Usage

Modify ${HADOOP_HOME}/conf/hadoop-env.sh to include the hbase jar, the zookeeper jar (can be found in lib/ directory under HBase root, the examples output directory, and the hbase conf directory in HADOOP_CLASSPATH, and then run bin/hadoop org.apache.hadoop.hbase.mapreduce.IndexBuilder TABLE_NAME COLUMN_FAMILY ATTR [ATTR ...]

To run with the sample data provided in index-builder-setup.rb, use the arguments people attributes name email phone.

This code was written against HBase 0.21 trunk.


Nested Class Summary
static class IndexBuilder.Map
          Internal Mapper to be run by Hadoop.
 
Field Summary
static byte[] INDEX_COLUMN
          the column family containing the indexed row key
static byte[] INDEX_QUALIFIER
          the qualifier containing the indexed row key
 
Constructor Summary
IndexBuilder()
           
 
Method Summary
static org.apache.hadoop.mapreduce.Job configureJob(org.apache.hadoop.conf.Configuration conf, String[] args)
          Job configuration.
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INDEX_COLUMN

public static final byte[] INDEX_COLUMN
the column family containing the indexed row key


INDEX_QUALIFIER

public static final byte[] INDEX_QUALIFIER
the qualifier containing the indexed row key

Constructor Detail

IndexBuilder

public IndexBuilder()
Method Detail

configureJob

public static org.apache.hadoop.mapreduce.Job configureJob(org.apache.hadoop.conf.Configuration conf,
                                                           String[] args)
                                                    throws IOException
Job configuration.

Throws:
IOException

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


Copyright © 2015 The Apache Software Foundation. All rights reserved.