Writing Data to HBase
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
Use the HBase client's write buffer to automatically batch:
The primary interface in the
storm-hbase connector is the
However, the default implementation,
SimpleHBaseMapper, writes a
single column family. Storm developers can implement the
interface themselves or extend
SimpleHBaseMapper if they want to
change or override this behavior.
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() .withRowKeyField("word") .withColumnFields(new Fields("word")) .withCounterFields(new Fields("count")) .withColumnFamily("cf");