Search in sources :

Example 1 with PhoenixAdapter

use of com.alibaba.otter.canal.client.adapter.phoenix.PhoenixAdapter in project canal by alibaba.

the class Common method init.

public static PhoenixAdapter init() {
    DatasourceConfig.DATA_SOURCES.put("defaultDS", TestConstant.dataSource);
    OuterAdapterConfig outerAdapterConfig = new OuterAdapterConfig();
    outerAdapterConfig.setName("phoenix");
    outerAdapterConfig.setKey("phoenix");
    Map<String, String> properties = new HashMap<>();
    properties.put("jdbc.driverClassName", "org.apache.phoenix.jdbc.PhoenixDriver");
    properties.put("jdbc.url", "jdbc:phoenix:zookeeper01,zookeeper02,zookeeper03:2181:/hbase/db");
    outerAdapterConfig.setProperties(properties);
    PhoenixAdapter adapter = new PhoenixAdapter();
    adapter.init(outerAdapterConfig, null);
    return adapter;
}
Also used : HashMap(java.util.HashMap) OuterAdapterConfig(com.alibaba.otter.canal.client.adapter.support.OuterAdapterConfig) PhoenixAdapter(com.alibaba.otter.canal.client.adapter.phoenix.PhoenixAdapter)

Aggregations

PhoenixAdapter (com.alibaba.otter.canal.client.adapter.phoenix.PhoenixAdapter)1 OuterAdapterConfig (com.alibaba.otter.canal.client.adapter.support.OuterAdapterConfig)1 HashMap (java.util.HashMap)1