Search in sources :

Example 1 with HbaseTemplate

use of com.pamirs.attach.plugin.dynamic.template.HbaseTemplate in project LinkAgent by shulieTech.

the class ConnectionShadowInterceptor method attachment.

void attachment(Advice advice) {
    try {
        Object[] args = advice.getParameterArray();
        Configuration configuration = (Configuration) args[0];
        String quorum = configuration.get(HConstants.ZOOKEEPER_QUORUM);
        String port = configuration.get(HConstants.ZOOKEEPER_CLIENT_PORT);
        String znode = configuration.get(HConstants.ZOOKEEPER_ZNODE_PARENT);
        ResourceManager.set(new Attachment(null, "apache-hbase", new String[] { "hbase" }, new HbaseTemplate().setZookeeper_quorum(quorum).setZookeeper_client_port(port).setZookeeper_znode_parent(znode)));
    } catch (Throwable t) {
    }
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) HbaseTemplate(com.pamirs.attach.plugin.dynamic.template.HbaseTemplate) Attachment(com.pamirs.attach.plugin.dynamic.Attachment)

Aggregations

Attachment (com.pamirs.attach.plugin.dynamic.Attachment)1 HbaseTemplate (com.pamirs.attach.plugin.dynamic.template.HbaseTemplate)1 Configuration (org.apache.hadoop.conf.Configuration)1