Book Image

Learning HBase

By : Shashwat Shriparv
Book Image

Learning HBase

By: Shashwat Shriparv

Overview of this book

Table of Contents (18 chapters)
Learning HBase
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Data model operations


The operations that are the basic blocks of data model are Get, Put, Scan, and Delete, using which we can read, write, and delete records from an HBase table. We will discuss these operations in detail now.

Get

The Get operation can fetch certain records from an HBase table. It is similar to the select [fields] where RowKey=<Row Key value here> statement in relational databases, where we fetch a row from the table.

The following is the representation of Get:

public Result get(Get get)throws IOException

In the preceding code, the Get operation can be provided as a single get object out of a list of get objects as get(List<Get> gets). It is specified by Get in the HTableInterface interface given by HBase. The Get operation receives the get parameter, which objects the data that is to be fetched from the table. It returns data of the particular row, which is specified in the get object as an HBase Result object, and this throws IOException when not able to read...