use of com.hortonworks.streamline.common.exception.ConfigException in project streamline by hortonworks.
the class TopologyMetricsContainer method initTopologyMetrics.
private TopologyMetrics initTopologyMetrics(Map<String, Object> conf, String className) {
try {
TopologyMetrics topologyMetrics = instantiate(className);
topologyMetrics.init(conf);
return topologyMetrics;
} catch (IllegalAccessException | InstantiationException | ClassNotFoundException | ConfigException e) {
throw new RuntimeException("Can't initialize Topology metrics instance - Class Name: " + className, e);
}
}
use of com.hortonworks.streamline.common.exception.ConfigException in project streamline by hortonworks.
the class AmbariInfraWithStormLogSearch method init.
/**
* {@inheritDoc}
*/
@Override
public void init(Map<String, Object> conf) throws ConfigException {
String solrApiUrl = null;
String collectionName = null;
if (conf != null) {
solrApiUrl = (String) conf.get(SOLR_API_URL_KEY);
collectionName = (String) conf.get(COLLECTION_NAME);
if (collectionName == null) {
collectionName = DEFAULT_COLLECTION_NAME;
}
}
if (solrApiUrl == null || collectionName == null) {
throw new ConfigException("'solrApiUrl' must be presented in configuration.");
}
if ((boolean) conf.getOrDefault(SECURED_CLUSTER, false)) {
HttpClientUtil.addConfigurer(new Krb5HttpClientConfigurer());
}
solr = new HttpSolrClient.Builder(solrApiUrl + "/" + collectionName).build();
}
use of com.hortonworks.streamline.common.exception.ConfigException in project streamline by hortonworks.
the class AmbariMetricsServiceWithStormQuerier method init.
/**
* {@inheritDoc}
*/
@Override
public void init(Map<String, String> conf) throws ConfigException {
if (conf != null) {
try {
collectorApiUri = new URI(conf.get(COLLECTOR_API_URL));
appId = conf.get(APP_ID);
if (appId == null) {
appId = DEFAULT_APP_ID;
}
} catch (URISyntaxException e) {
throw new ConfigException(e);
}
}
client = ClientBuilder.newClient(new ClientConfig());
}
use of com.hortonworks.streamline.common.exception.ConfigException in project streamline by hortonworks.
the class GraphiteWithStormQuerier method init.
/**
* {@inheritDoc}
*/
@Override
public void init(Map<String, String> conf) throws ConfigException {
if (conf != null) {
try {
renderApiUrl = new URI(conf.get(RENDER_API_URL));
metricNamePrefix = conf.get(METRIC_NAME_PREFIX);
useFQDN = BooleanUtils.toBoolean(conf.get(USE_FQDN));
} catch (URISyntaxException e) {
throw new ConfigException(e);
}
}
client = ClientBuilder.newClient(new ClientConfig());
}
use of com.hortonworks.streamline.common.exception.ConfigException in project streamline by hortonworks.
the class TopologyMetricsContainer method initTimeSeriesQuerier.
private TimeSeriesQuerier initTimeSeriesQuerier(Map<String, String> conf, String className) {
try {
Class<?> timeSeriesQuerierImplClass = Class.forName(className);
TimeSeriesQuerier timeSeriesQuerier = (TimeSeriesQuerier) timeSeriesQuerierImplClass.newInstance();
timeSeriesQuerier.init(conf);
return timeSeriesQuerier;
} catch (IllegalAccessException | InstantiationException | ClassNotFoundException | ConfigException e) {
throw new RuntimeException("Can't initialize Time-series Querier instance - Class Name: " + className, e);
}
}
Aggregations