I want to build a trident topology which will get tuples from Kafka, group them by one field and persist entire grouped tuples in HBase. Reason for grouping is that HBase put operations are faster with multiple put objects compared to putting single object, I want to group Put
objects by one field and insert all those Put
objects in single HBase API call.
I have written following code but not sure where should I write code which will convert all tuples into HBase 'Put' type objects and persist all those Put objects in HBase.
OpaqueTridentKafkaSpout kafkaTridentSpout = new OpaqueTridentKafkaSpout(spoutConfig);
TridentTopology topology = new TridentTopology();
topology.newStream("stream", kafkaTridentSpout)
.groupBy(new Fields("pointId"))
.toStream();
topology.build();
Can anyone please help me?