ctx.put("batchSize", "2");
HBaseSink sink = new HBaseSink(conf);
Configurables.configure(sink, ctx);
//Reset the context to a higher batchSize
ctx.put("batchSize", "100");
Channel channel = new MemoryChannel();
Configurables.configure(channel, new Context());
sink.setChannel(channel);
logger.info("Writing data into channel");
Transaction tx = channel.getTransaction();
tx.begin();
for(int i = 0; i < 3; i++){
Event e = EventBuilder.withBody(Bytes.toBytes(valBase + "-" + i));
channel.put(e);
}
tx.commit();
tx.close();
logger.info("Starting sink and processing events");