Writing your own MapReduce job to import data
Although the importtsv
tool is very useful for loading text files into HBase, in many cases, for full control of the loading process you may want to write your own MapReduce job to import data into HBase. For example, the importtsv
tool does not work if you are going to load files of other formats.
HBase provides TableOutputFormat
for writing data into an HBase table from a MapReduce job. You can also generate its internal HFile format files in your MapReduce job by using the HFileOutputFormat
class, and then load the generated files into a running HBase cluster, using the completebulkload
tool we described in the previous recipe.
In this recipe, we will explain the steps for loading data using your ...
Get HBase Administration Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.