Database Reference
In-Depth Information
Increment(byte[] row)
Increment(byte[] row, int offset, int length)
The preceding methods create an Increment operation for the speciied row. A row
key is provided while instantiating an Increment object. This row key represents
the row that contains all the counters to be modiied by making a subsequent call to
the increment() method. Once the Increment instance is created, addition of the
counters or columns to be incremented are added using the following method:
Increment addColumn(byte[] family, byte[] qualifier, long amount)
The following are examples of multiple counters:
Increment increment = new Increment(Bytes.toBytes("Jan14"));
increment.addColumn(Bytes.toBytes("monthly"), Bytes.toBytes("hits"), 10);
increment.addColumn(Bytes.toBytes("monthly"), Bytes.toBytes("hits"), 1);
increment.addColumn(Bytes.toBytes("monthly"), Bytes.toBytes("hits"), 20);
Result result = table.increment(increment);
Coprocessors
In an HBase cluster, the most computationally expensive portion of reading or writing
operations happens when we apply server-side ilters on scan results; although,
this computation is very much speciic to accessing the data. Similarly, with the
coprocessor, we can move a part of the computation to where the data lives, like in the
case of Hadoop, which works in a distributed way for data storage (HDFS), as well
as data processing (MapReduce). Using HBase coprocessors, custom features such as
secondary indexing, complex iltering and access control features can be developed.
HBase coprocessor-based code run in parallel across all RegionServers and convert
the cluster from horizontally scalable storage to a highly capable, distributed, data
storage and data-processing system. The HBase coprocessor's design is inspired by
Google's BigTable coprocessor's design.
In an HBase cluster, coprocessor works in two different scopes:
• System level: These coprocessors can be loaded globally on any or all tables
and regions hosted by the region server
• Table level: These coprocessors can be loaded on all regions of a table on a
per table basis
 
Search WWH ::




Custom Search