Chapter 9. Advance Coding in Java for HBase

In this chapter, we will learn about some more advance coding on topics such as administrative tasks; available interfaces, classes, and exceptions in HBase; writing a MapReduce for HBase; and operations on HDFS. We will also discuss details on REST and Thrift API services and other advance topics such as coprocessors, bloom filters, and available HBase tools for value addition.

In this chapter, we will cover the following topics:

  • Interfaces, classes, and exceptions in HBase
  • Java code for performing administrative tasks
  • Data operation codes
  • MapReduce in HBase
  • REST/Thrift web service introduction
  • Advance concepts in HBase
  • Information about some add-on projects

Interfaces, classes, and exceptions

Interface is a set of abstract methods. A class in Java implements an interface and inherits the abstract methods of the interface. It is not a class. Writing an interface is the same as writing a class. A class tells us about the attributes and behaviors of an object. An interface contains behaviors that a class implements.

Class is a template/blueprint that describes the behavior that an object supports.

Exception is a problem that arises during the execution of a program.

Here is the list of some packages to be used in Java code:

  • org.apache.hadoop.hbase: This package contains a base class for HBase
  • org.apache.hadoop.hbase.backup: This package contains classes related to backup tasks
  • org.apache.hadoop.hbase.client: This package contains a client-related class
  • org.apache.hadoop.hbase.codec: This package contains the Codec interface
  • org.apache.hadoop.hbase.coprocessor: This package is used to write coprocessors
  • org.apache.hadoop.hbase.exceptions: This package contains the predefined exception in HBase
  • org.apache.hadoop.hbase.filter: This package provides a list of filters
  • org.apache.hadoop.hbase.http: This package contains HTTP functionalities
  • org.apache.hadoop.hbase.io: This package contains I/O-related methods
  • org.apache.hadoop.hbase.ipc: This package contains methods related to RPC connection
  • org.apache.hadoop.hbase.mapred: This package contains MapReduce-related methods
  • org.apache.hadoop.hbase.mapreduce: This is the newer MapReduce package, which provides HBase MapReduce I/O formats, a table indexing MapReduce job, and utility methods
  • org.apache.hadoop.hbase.master: This package is used while interacting with the master
  • org.apache.hadoop.hbase.monitoring: This package exports methods for monitoring
  • org.apache.hadoop.hbase.regionserver: This package is used when interacting with RegionServers
  • org.apache.hadoop.hbase.rest: This package provides REST API
  • org.apache.hadoop.hbase.security: This package is used for tasks related to security
  • org.apache.hadoop.hbase.snapshot: This package is used for backup and snapshot
  • org.apache.hadoop.hbase.thrift: This package provides Thrift services
  • org.apache.hadoop.hbase.tool: This package provides miscellaneous tools
  • org.apache.hadoop.hbase.types: This package provides the definition and implementation of HBase's extensible data type API
  • org.apache.hadoop.hbase.util: This package provides utilities
  • org.apache.hadoop.hbase.zookeeper: This package is used for tasks related to ZooKeepers

Note

All the important packages, interfaces, and a list of the updated APIs can be found at http://hbase.apache.org/devapidocs/index.html.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.128.105