use of org.apache.hadoop.hbase.client.HConnection in project metron by apache.
the class CIFHbaseAdapter method initializeAdapter.
@Override
public boolean initializeAdapter(Map<String, Object> config) {
// Initialize HBase Table
Configuration conf = null;
conf = HBaseConfiguration.create();
conf.set("hbase.zookeeper.quorum", _quorum);
conf.set("hbase.zookeeper.property.clientPort", _port);
try {
LOGGER.debug("=======Connecting to HBASE===========");
LOGGER.debug("=======ZOOKEEPER = {}", conf.get("hbase.zookeeper.quorum"));
HConnection connection = HConnectionManager.createConnection(conf);
table = connection.getTable(_tableName);
return true;
} catch (IOException e) {
LOGGER.debug("=======Unable to Connect to HBASE===========");
e.printStackTrace();
}
return false;
}
Aggregations