@InterfaceAudience.Public @InterfaceStability.Stable public class Import extends org.apache.hadoop.conf.Configured implements org.apache.hadoop.util.Tool
Export.| Modifier and Type | Class and Description |
|---|---|
static class |
Import.Importer
Write table content out to files.
|
static class |
Import.KeyValueImporter
A mapper that just writes out KeyValues.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
BULK_OUTPUT_CONF_KEY
Constant
BULK_OUTPUT_CONF_KEY="import.bulk.output" |
static String |
CF_RENAME_PROP
Constant
CF_RENAME_PROP="HBASE_IMPORTER_RENAME_CFS" |
static String |
FILTER_ARGS_CONF_KEY
Constant
FILTER_ARGS_CONF_KEY="import.filter.args" |
static String |
FILTER_CLASS_CONF_KEY
Constant
FILTER_CLASS_CONF_KEY="import.filter.class" |
static String |
TABLE_NAME
Constant
TABLE_NAME="import.table.name" |
| Constructor and Description |
|---|
Import() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addFilterAndArguments(org.apache.hadoop.conf.Configuration conf,
Class<? extends Filter> clazz,
List<String> filterArgs)
Add a Filter to be instantiated on import
|
static void |
configureCfRenaming(org.apache.hadoop.conf.Configuration conf,
Map<String,String> renameMap)
Sets a configuration property with key
CF_RENAME_PROP in conf that tells the mapper
how to rename column families. |
static org.apache.hadoop.mapreduce.Job |
createSubmittableJob(org.apache.hadoop.conf.Configuration conf,
String[] args)
Sets up the actual job.
|
static Cell |
filterKv(Filter filter,
Cell kv)
Attempt to filter out the keyvalue
|
static Filter |
instantiateFilter(org.apache.hadoop.conf.Configuration conf)
|
static void |
main(String[] args)
Main entry point.
|
int |
run(String[] args) |
public static final String CF_RENAME_PROP
CF_RENAME_PROP="HBASE_IMPORTER_RENAME_CFS"public static final String BULK_OUTPUT_CONF_KEY
BULK_OUTPUT_CONF_KEY="import.bulk.output"public static final String FILTER_CLASS_CONF_KEY
FILTER_CLASS_CONF_KEY="import.filter.class"public static final String FILTER_ARGS_CONF_KEY
FILTER_ARGS_CONF_KEY="import.filter.args"public static final String TABLE_NAME
TABLE_NAME="import.table.name"public static Filter instantiateFilter(org.apache.hadoop.conf.Configuration conf)
Filter to apply to all incoming keys (KeyValues) to optionally not include in the job outputconf - Configuration from which to load the filterIllegalArgumentException - if the filter is misconfiguredpublic static Cell filterKv(Filter filter, Cell kv) throws IOException
kv - KeyValue on which to apply the filterfilter - a Filter object.KeyValueIOException - if any.public static void configureCfRenaming(org.apache.hadoop.conf.Configuration conf,
Map<String,String> renameMap)
CF_RENAME_PROP in conf that tells the mapper
how to rename column families.
Alternately, instead of calling this function, you could set the configuration key CF_RENAME_PROP yourself. The value should look like
srcCf1:destCf1,srcCf2:destCf2,..... This would have the same effect on the mapper behavior.
conf - the Configuration in which the CF_RENAME_PROP key will be setrenameMap - a mapping from source CF names to destination CF namespublic static void addFilterAndArguments(org.apache.hadoop.conf.Configuration conf,
Class<? extends Filter> clazz,
List<String> filterArgs)
conf - Configuration to update (will be passed to the job)clazz - Filter subclass to instantiate on the
server.filterArgs - List of arguments to pass to the filter on instantiationpublic static org.apache.hadoop.mapreduce.Job createSubmittableJob(org.apache.hadoop.conf.Configuration conf,
String[] args)
throws IOException
conf - The current configuration.args - The command line parameters.IOException - When setting up the job fails.public int run(String[] args) throws Exception
run in interface org.apache.hadoop.util.ToolException