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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String(package private) static final String(package private) static final Class(package private) static final String(package private) static final Stringstatic final Stringprivate static booleanIf table didn't exist and was created in dry-run mode, this flag is flipped to delete it when MR ends.static final Stringprotected static final org.slf4j.Loggerstatic final Stringstatic final String(package private) static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static org.apache.hadoop.mapreduce.JobcreateSubmittableJob(org.apache.hadoop.conf.Configuration conf, String[] args) Sets up the actual job.private static voidcreateTable(Admin admin, TableName tableName, String[] columns) private static voiddeleteTable(org.apache.hadoop.conf.Configuration conf, String[] args) getColumnFamilies(String[] columns) static voidintprivate static voidMethods inherited from class org.apache.hadoop.conf.Configured
getConf, setConfMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
runin interfaceorg.apache.hadoop.util.Tool- Throws:
Exception
-
main
- Throws:
Exception
-