简体   繁体   中英

mapreduce, hbase and scan

I have a MapReduce job that extends the TableMapper class. I use the TableMapperReduceUtil initTableMapperJob to setup the initial scan which works fine. Based on the rowkey retrieved from the Scan I want to run a Get (using a rowkey which is a value in the initial Scan row) on the same table within my MapReduce Map method. How do I access the Hbase connection to the same table from within the Map method?

Probably you can create a new connection in this manner:

Configuration config = context.getConfiguration();
Connection conn = ConnectionFactory.createConnection(config);

But I think in your case it will be easier to use Spark on HBase

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM