O'Reilly logo

Hadoop MapReduce v2 Cookbook - Second Edition by Thilina Gunarathne

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Data random access using Java client APIs

The previous recipe introduced the command-line interface for HBase. This recipe demonstrates how we can use the Java API to interact with HBase.

Getting ready

This recipe requires an Apache HBase installation integrated with a Hadoop YARN cluster. Make sure to start all the configured HBase Master and RegionServer processes before we begin.

How to do it...

The following step executes an HBase Java client to store and retrieve data from an HBase table.

Run the HBaseClient Java program by running the following command from the chapter 7 folder of the sample source repository:

$ gradle execute HBaseClient

How it works...

The source code for the preceding Java program is available in the chapter7/src/chapter7/hbase/HBaseClient.java ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required