use of org.apache.metron.common.configuration.Configurations in project metron by apache.
the class SolrIndexingIntegrationTest method getSearchComponent.
@Override
public InMemoryComponent getSearchComponent(final Properties topologyProperties) throws Exception {
SolrComponent solrComponent = new SolrComponent.Builder().addCollection(collection, "../metron-solr/src/test/resources/solr/conf").withPostStartCallback(new Function<SolrComponent, Void>() {
@Nullable
@Override
public Void apply(@Nullable SolrComponent solrComponent) {
topologyProperties.setProperty("solr.zk", solrComponent.getZookeeperUrl());
try {
String testZookeeperUrl = topologyProperties.getProperty(ZKServerComponent.ZOOKEEPER_PROPERTY);
Configurations configurations = SampleUtil.getSampleConfigs();
Map<String, Object> globalConfig = configurations.getGlobalConfig();
globalConfig.put("solr.zookeeper", solrComponent.getZookeeperUrl());
ConfigurationsUtils.writeGlobalConfigToZookeeper(JSONUtils.INSTANCE.toJSONPretty(globalConfig), testZookeeperUrl);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}).build();
return solrComponent;
}
use of org.apache.metron.common.configuration.Configurations in project metron by apache.
the class BaseValidationTest method getConfiguration.
public Configurations getConfiguration(String config) throws IOException {
Configurations configurations = new Configurations();
configurations.updateGlobalConfig(Bytes.toBytes(config));
return configurations;
}
use of org.apache.metron.common.configuration.Configurations in project metron by apache.
the class BaseValidationTest method execute.
public boolean execute(String config, Map<String, Object> input) throws IOException {
Configurations configurations = getConfiguration(config);
FieldValidator validator = getValidator(configurations);
return validator.isValid(new JSONObject(input), configurations.getGlobalConfig(), Context.EMPTY_CONTEXT());
}
use of org.apache.metron.common.configuration.Configurations in project metron by apache.
the class SolrIndexingIntegrationTest method getSearchComponent.
@Override
public InMemoryComponent getSearchComponent(final Properties topologyProperties) throws Exception {
SolrComponent solrComponent = new SolrComponent.Builder().addInitialCollection(collection, "../metron-solr-common/src/main/config/schema/yaf").withPostStartCallback(new Function<SolrComponent, Void>() {
@Nullable
@Override
public Void apply(@Nullable SolrComponent solrComponent) {
topologyProperties.setProperty("solr.zk", solrComponent.getZookeeperUrl());
try {
String testZookeeperUrl = topologyProperties.getProperty(ZKServerComponent.ZOOKEEPER_PROPERTY);
Configurations configurations = SampleUtil.getSampleConfigs();
Map<String, Object> globalConfig = configurations.getGlobalConfig();
globalConfig.put(SolrConstants.SOLR_ZOOKEEPER, solrComponent.getZookeeperUrl());
ConfigurationsUtils.writeGlobalConfigToZookeeper(JSONUtils.INSTANCE.toJSONPretty(globalConfig), testZookeeperUrl);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}).build();
return solrComponent;
}
Aggregations