Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning Hbase
  • Table Of Contents Toc
Learning Hbase

Learning Hbase

By : Shriparv
4.1 (8)
close
close
Learning Hbase

Learning Hbase

4.1 (8)
By: Shriparv

Overview of this book

If you are an administrator or developer who wants to enter the world of Big Data and BigTables and would like to learn about HBase, this is the book for you.
Table of Contents (12 chapters)
close
close
11
Index

Data operation code


Data operation code is all about adding a record, deleting a record, and getting a single record. It will also help in scanning the table and listing all records.

Let's see how we can build our own function to perform various tasks:

public void addOneRecordToTable(String tableObjName, String rowKey,
String colFamName, String columnName, String data) throws Exception
{
  try
  {
    HTable tableObj = new HTable(configurationObj, tableObjName);
    Put put = new Put(Bytes.toBytes(rowKey));
    put.add(Bytes.toBytes(colFamName), Bytes.toBytes(columnName), Bytes
    .toBytes(data));
    tableObj.put(put);
  }
  catch (IOException exception)
  {
    exception.printStackTrace();
  }
}
public  void delRecordFromTable(String tableObjName, String rowKey) throws IOException
{
  HTable tableObj = new HTable(configurationObj, tableObjName);
  List<Delete>list = new ArrayList<Delete>();
  Delete delObj = new Delete(rowKey.getBytes());
  list.add(delObj);
  tableObj.delete...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning Hbase
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon