Search in sources :

Example 1 with ConfigException

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);
    }
}
Also used : TopologyMetrics(com.hortonworks.streamline.streams.metrics.topology.TopologyMetrics) ConfigException(com.hortonworks.streamline.common.exception.ConfigException)

Example 2 with ConfigException

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();
}
Also used : Krb5HttpClientConfigurer(org.apache.solr.client.solrj.impl.Krb5HttpClientConfigurer) ConfigException(com.hortonworks.streamline.common.exception.ConfigException)

Example 3 with ConfigException

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());
}
Also used : ConfigException(com.hortonworks.streamline.common.exception.ConfigException) URISyntaxException(java.net.URISyntaxException) ClientConfig(org.glassfish.jersey.client.ClientConfig) URI(java.net.URI)

Example 4 with ConfigException

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());
}
Also used : ConfigException(com.hortonworks.streamline.common.exception.ConfigException) URISyntaxException(java.net.URISyntaxException) ClientConfig(org.glassfish.jersey.client.ClientConfig) URI(java.net.URI)

Example 5 with ConfigException

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);
    }
}
Also used : TimeSeriesQuerier(com.hortonworks.streamline.streams.metrics.TimeSeriesQuerier) ConfigException(com.hortonworks.streamline.common.exception.ConfigException)

Aggregations

ConfigException (com.hortonworks.streamline.common.exception.ConfigException)6 URI (java.net.URI)2 URISyntaxException (java.net.URISyntaxException)2 ClientConfig (org.glassfish.jersey.client.ClientConfig)2 DefaultTopologyLogSearch (com.hortonworks.streamline.streams.logsearch.DefaultTopologyLogSearch)1 TopologyLogSearch (com.hortonworks.streamline.streams.logsearch.TopologyLogSearch)1 TimeSeriesQuerier (com.hortonworks.streamline.streams.metrics.TimeSeriesQuerier)1 TopologyMetrics (com.hortonworks.streamline.streams.metrics.topology.TopologyMetrics)1 Krb5HttpClientConfigurer (org.apache.solr.client.solrj.impl.Krb5HttpClientConfigurer)1