Class ImportTsv
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.hbase.mapreduce.ImportTsv
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
,org.apache.hadoop.util.Tool
@Public
public class ImportTsv
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.util.Tool
Tool to import data from a TSV file. This tool is rather simplistic - it doesn't do any quoting
or escaping, but is useful for many data loads.
- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
(package private) static final String
(package private) static final Class
(package private) static final String
(package private) static final String
static final String
private static boolean
If table didn't exist and was created in dry-run mode, this flag is flipped to delete it when MR ends.static final String
protected static final org.slf4j.Logger
static final String
static final String
(package private) static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static org.apache.hadoop.mapreduce.Job
createSubmittableJob
(org.apache.hadoop.conf.Configuration conf, String[] args) Sets up the actual job.private static void
createTable
(Admin admin, TableName tableName, String[] columns) private static void
deleteTable
(org.apache.hadoop.conf.Configuration conf, String[] args) getColumnFamilies
(String[] columns) static void
int
private static void
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
-
Field Details
-
LOG
-
NAME
- See Also:
-
MAPPER_CONF_KEY
- See Also:
-
BULK_OUTPUT_CONF_KEY
- See Also:
-
TIMESTAMP_CONF_KEY
- See Also:
-
JOB_NAME_CONF_KEY
- See Also:
-
DRY_RUN_CONF_KEY
- See Also:
-
LOG_BAD_LINES_CONF_KEY
- See Also:
-
SKIP_LINES_CONF_KEY
- See Also:
-
SKIP_EMPTY_COLUMNS
- See Also:
-
COLUMNS_CONF_KEY
- See Also:
-
SEPARATOR_CONF_KEY
- See Also:
-
ATTRIBUTE_SEPERATOR_CONF_KEY
- See Also:
-
CREDENTIALS_LOCATION
- See Also:
-
DEFAULT_SEPARATOR
- See Also:
-
DEFAULT_ATTRIBUTES_SEPERATOR
- See Also:
-
DEFAULT_MULTIPLE_ATTRIBUTES_SEPERATOR
- See Also:
-
DEFAULT_MAPPER
-
CREATE_TABLE_CONF_KEY
- See Also:
-
NO_STRICT_COL_FAMILY
- See Also:
-
DRY_RUN_TABLE_CREATED
If table didn't exist and was created in dry-run mode, this flag is flipped to delete it when MR ends.
-
-
Constructor Details
-
ImportTsv
public ImportTsv()
-
-
Method Details
-
createSubmittableJob
protected static org.apache.hadoop.mapreduce.Job createSubmittableJob(org.apache.hadoop.conf.Configuration conf, String[] args) throws IOException, ClassNotFoundException Sets up the actual job.- Parameters:
conf
- The current configuration.args
- The command line parameters.- Returns:
- The newly created job.
- Throws:
IOException
- When setting up the job fails.ClassNotFoundException
-
createTable
private static void createTable(Admin admin, TableName tableName, String[] columns) throws IOException - Throws:
IOException
-
deleteTable
-
getColumnFamilies
-
usage
-
run
- Specified by:
run
in interfaceorg.apache.hadoop.util.Tool
- Throws:
Exception
-
main
- Throws:
Exception
-