use of org.apache.metron.common.zookeeper.ZKConfigurationsCache in project metron by apache.
the class SolrUpdateIntegrationTest method setup.
@BeforeEach
public void setup() throws Exception {
solrComponent.addCollection(SENSOR_NAME, "./src/test/resources/config/test/conf");
solrComponent.addCollection("error", "./src/main/config/schema/error");
Map<String, Object> globalConfig = createGlobalConfig();
globalConfig.put(HBaseDao.HBASE_TABLE, TABLE_NAME);
globalConfig.put(HBaseDao.HBASE_CF, CF);
CuratorFramework client = ConfigurationsUtils.getClient(solrComponent.getZookeeperUrl());
client.start();
ZKConfigurationsCache cache = new ZKConfigurationsCache(client);
cache.start();
AccessConfig accessConfig = new AccessConfig();
accessConfig.setGlobalConfigSupplier(() -> globalConfig);
accessConfig.setIndexSupplier(s -> s);
accessConfig.setIndexSupplier(IndexingCacheUtil.getIndexLookupFunction(cache, "solr"));
SolrDao dao = new SolrDao();
dao.init(accessConfig);
setDao(dao);
}
Aggregations