Search code examples
hbaseapache-storm

Storm writing to multiple HBase tables from the same bolt?


I have a storm topology that reads data in from a kafka topic and stores it into a hbase table, i'm wondering is there any way to dynamically decide on which table the message gets written to based on data in the kafka message?


Solution

  • Are you using the default HBase bolt?

    There are a couple of ways you could do this. You could create a bolt that implements your logic and emits the tuple in one of several streams with HBase bolts at the other end subscribing to the correct stream. If your logic is very complex and the number of bolts required to do this becomes over the top, you could always write a bolt that implements both your table selection logic and the insert to HBase.