Hi,
Is there a way to instantiate one object and share that object among
executors on the same worker?
One of the bolts of my topology reads from HBase using HTable. I configure
that bolt to have a couple hundred executors. Currently every executor
instantiates HTable in prepare() method like:
Configuration config = HBaseConfiguration.create();
config.set("hbase.zookeeper.property.clientPort", "2181");
config.set("hbase.zookeeper.quorum", "host1,host2");
table = new HTable(config, "table");
The problem of this is every executor has its own Configuration and
therefore each HTable is having its own underlying HConnection instance.
But it would be nice to share the underlying HConnection within the same
host. This means I will need to instantiate ONE Configuration per host (i.e
per worker as I have configured one worker per host for my topology) and
share it among all executors within the same worker.
Is there a way I can do this programatically?
Thanks,
BH