public class SampleUploader extends Object
This is EXAMPLE code. You will need to change it to work for your context.
Uses TableReducer
to put the data into HBase. Change the InputFormat
to suit your data. In this example, we are importing a CSV file.
row,family,qualifier,value
The table and columnfamily we're to insert into must preexist.
There is no reducer in this example as it is not necessary and adds significant overhead. If you need to do any massaging of data before inserting into HBase, you can do this in the map as well.
Do the following to start the MR job:
./bin/hadoop org.apache.hadoop.hbase.mapreduce.SampleUploader /tmp/input.csv TABLE_NAME
This code was written against HBase 0.21 trunk.
Constructor and Description |
---|
SampleUploader() |
Modifier and Type | Method and Description |
---|---|
static org.apache.hadoop.mapreduce.Job |
configureJob(org.apache.hadoop.conf.Configuration conf,
String[] args)
Job configuration.
|
static void |
main(String[] args)
Main entry point.
|
public static org.apache.hadoop.mapreduce.Job configureJob(org.apache.hadoop.conf.Configuration conf, String[] args) throws IOException
IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.