Apache Storm Component Guide
Also available as:
loading table of contents...

Writing Data to HBase

The storm-hbase connector enables Storm developers to collect several PUTS in a single operation and write to multiple HBase column families and counter columns. A PUT is an HBase operation that inserts data into a single HBase cell. Use the HBase client's write buffer to automatically batch: hbase.client.write.buffer.

The primary interface in the storm-hbase connector is the org.apache.storm.hbase.bolt.mapper.HBaseMapper interface. However, the default implementation, SimpleHBaseMapper, writes a single column family. Storm developers can implement the HBaseMapper interface themselves or extend SimpleHBaseMapper if they want to change or override this behavior.

SimpleHBaseMapper Methods


Specifies the row key for the target HBase row. A row key uniquely identifies a row in HBase


Specifies the target HBase column.


Specifies the target HBase counter.


Specifies the target HBase column family.


The following example specifies the 'word' tuple as the row key, adds an HBase column for the tuple 'word' field, adds an HBase counter column for the tuple 'count' field, and writes data to the 'cf' column family.

SimpleHBaseMapper mapper = new SimpleHBaseMapper()
 .withColumnFields(new Fields("word"))
 .withCounterFields(new Fields("count"))