當前位置: 首頁>>代碼示例>>Java>>正文


Java VerifiableProperties.getBoolean方法代碼示例

本文整理匯總了Java中kafka.utils.VerifiableProperties.getBoolean方法的典型用法代碼示例。如果您正苦於以下問題:Java VerifiableProperties.getBoolean方法的具體用法?Java VerifiableProperties.getBoolean怎麽用?Java VerifiableProperties.getBoolean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在kafka.utils.VerifiableProperties的用法示例。


在下文中一共展示了VerifiableProperties.getBoolean方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

import kafka.utils.VerifiableProperties; //導入方法依賴的package包/類
@Override
public synchronized void init(VerifiableProperties props) {
    if (!initialized) {
        KafkaMetricsConfig metricsConfig = new KafkaMetricsConfig(props);
        influxDBAddress = props.getString("kafka.influxdb.metrics.address", INFLUXDB_DEFAULT_ADDRESS);
        influxDBUsername = props.getString("kafka.influxdb.metrics.username", INFLUXDB_DEFAULT_USERNAME);
        influxDBPassword = props.getString("kafka.influxdb.metrics.password", INFLUXDB_DEFAULT_PASSWORD);
        influxDBConsistency = props.getString("kafka.influxdb.metrics.consistency", INFLUXDB_DEFAULT_CONSISTENCY);
        influxDBDatabase = props.getString("kafka.influxdb.metrics.database", INFLUXDB_DEFAULT_DATABASE);
        influxDBRetentionPolicy = props.getString("kafka.influxdb.metrics.retentionPolicy", INFLUXDB_DEFAULT_RETENTIONPOLICY);
        influxDBTags = props.getString("kafka.influxdb.metrics.tags", INFLUXDB_DEFAULT_TAGS);
        metricDimensions = Dimension.fromProperties(props.props(), "kafka.influxdb.dimension.enabled.");

        LOG.debug("Initialize InfluxDBReporter [{},{},{}]", influxDBAddress, influxDBDatabase, influxDBRetentionPolicy);

        reporter = buildInfluxDBReporter();

        if (props.getBoolean("kafka.influxdb.metrics.reporter.enabled", false)) {
            initialized = true;
            startReporter(metricsConfig.pollingIntervalSecs());
            LOG.debug("InfluxDBReporter started.");
        }
    }
}
 
開發者ID:jasper-zhang,項目名稱:kafka-influxdb,代碼行數:25,代碼來源:KafkaInfluxDBMetricsReporter.java

示例2: init

import kafka.utils.VerifiableProperties; //導入方法依賴的package包/類
@Override
public void init(VerifiableProperties props) {

    if(!initialized) {
        KafkaMetricsConfig metricsConfig = new KafkaMetricsConfig(props);

        InfluxDBMetricsConfig config = new InfluxDBMetricsConfig(props);
        config.addTag("brokerId", props.getString("broker.id"));

        this.reporter = new InfluxReporter(Metrics.defaultRegistry(), DEFAULT_NAME
                ,new InfluxDBClient(config), new MetricsPredicate(config.getPredicates()));

        if (props.getBoolean(InfluxDBMetricsConfig.KAFKA_INFLUX_METRICS_ENABLE, false)) {
            initialized = true;
            startReporter(metricsConfig.pollingIntervalSecs());
            LOG.info("KafkaInfluxMetricsReporter initialized.");
        }
    }
}
 
開發者ID:fhussonnois,項目名稱:kafka-influxdb-reporter,代碼行數:20,代碼來源:KafkaInfluxMetricsReporter.java

示例3: init

import kafka.utils.VerifiableProperties; //導入方法依賴的package包/類
@Override
public synchronized void init(VerifiableProperties props) {
    if (!initialized) {
        KafkaMetricsConfig metricsConfig = new KafkaMetricsConfig(props);
        graphiteHost = props.getString("kafka.graphite.metrics.host", GRAPHITE_DEFAULT_HOST);
        graphitePort = props.getInt("kafka.graphite.metrics.port", GRAPHITE_DEFAULT_PORT);
        metricPrefix = props.getString("kafka.graphite.metrics.group", GRAPHITE_DEFAULT_PREFIX);
        String excludeRegex = props.getString("kafka.graphite.metrics.exclude.regex", null);
        metricDimensions = Dimension.fromProperties(props.props(), "kafka.graphite.dimension.enabled.");

        LOG.debug("Initialize GraphiteReporter [{},{},{}]", graphiteHost, graphitePort, metricPrefix);

        if (excludeRegex != null) {
            LOG.debug("Using regex [{}] for GraphiteReporter", excludeRegex);
            metricPredicate = new FilterMetricPredicate(excludeRegex);
        }
        reporter = buildGraphiteReporter();

        if (props.getBoolean("kafka.graphite.metrics.reporter.enabled", false)) {
            initialized = true;
            startReporter(metricsConfig.pollingIntervalSecs());
            LOG.debug("GraphiteReporter started.");
        }
    }
}
 
開發者ID:damienclaveau,項目名稱:kafka-graphite,代碼行數:26,代碼來源:KafkaGraphiteMetricsReporter.java

示例4: loadConfig

import kafka.utils.VerifiableProperties; //導入方法依賴的package包/類
private void loadConfig(VerifiableProperties props) {
  enabled = props.getBoolean("external.kafka.statsd.reporter.enabled", false);
  host = props.getString("external.kafka.statsd.host", "localhost");
  port = props.getInt("external.kafka.statsd.port", 8125);
  prefix = props.getString("external.kafka.statsd.metrics.prefix", "");
  pollingPeriodInSeconds = props.getInt("kafka.metrics.polling.interval.secs", 10);
  metricDimensions = Dimension.fromProperties(props.props(), "external.kafka.statsd.dimension.enabled.");

  String excludeRegex = props.getString("external.kafka.statsd.metrics.exclude_regex", DEFAULT_EXCLUDE_REGEX);
  if (excludeRegex != null && excludeRegex.length() != 0) {
    metricPredicate = new ExcludeMetricPredicate(excludeRegex);
  } else {
    metricPredicate = MetricPredicate.ALL;
  }

  this.isTagEnabled = props.getBoolean("external.kafka.statsd.tag.enabled", true);
}
 
開發者ID:airbnb,項目名稱:kafka-statsd-metrics2,代碼行數:18,代碼來源:StatsdMetricsReporter.java

示例5: init

import kafka.utils.VerifiableProperties; //導入方法依賴的package包/類
@Override
public synchronized void init(VerifiableProperties props) {
	if (!initialized) {
		KafkaMetricsConfig metricsConfig = new KafkaMetricsConfig(props);
		statsdHost = props.getString("kafka.statsd.metrics.host", STATSD_DEFAULT_HOST).trim();
		statsdPort = props.getInt("kafka.statsd.metrics.port", STATSD_DEFAULT_PORT);
		statsdGroupPrefix = props.getString("kafka.statsd.metrics.group", STATSD_DEFAULT_PREFIX).trim();
           String regex = props.getString("kafka.statsd.metrics.exclude.regex", null);

           LOG.debug("Initialize StatsdReporter ["+statsdHost+","+statsdPort+","+statsdGroupPrefix+"]");

           if (regex != null) {
           	predicate = new RegexMetricPredicate(regex);
           }
           try {
           	reporter = new StatsdReporter(
           			Metrics.defaultRegistry(),
           			statsdGroupPrefix,
           			predicate,
           			statsdHost,
           			statsdPort,
           			Clock.defaultClock()
           			);
           } catch (IOException e) {
           	LOG.error("Unable to initialize StatsdReporter", e);
           }
           if (props.getBoolean("kafka.statsd.metrics.reporter.enabled", false)) {
           	initialized = true;
           	startReporter(metricsConfig.pollingIntervalSecs());
               LOG.debug("StatsdReporter started.");
           }
       }
   }
 
開發者ID:myfitnesspal,項目名稱:kafka-statsd-reporter,代碼行數:34,代碼來源:KafkaStatsdMetricsReporter.java

示例6: setMeasuresFilters

import kafka.utils.VerifiableProperties; //導入方法依賴的package包/類
private void setMeasuresFilters(VerifiableProperties props) {
    for (MetricsPredicate.Measures measure : MetricsPredicate.Measures.values()) {
        boolean enable = props.getBoolean(KAFKA_GRAPHITE_MEASURE_ENABLED_CONFIG + "." + measure.name(), true);
        this.predicates.put(measure, enable);
    }
}
 
開發者ID:fhussonnois,項目名稱:kafka-influxdb-reporter,代碼行數:7,代碼來源:InfluxDBMetricsConfig.java

示例7: init

import kafka.utils.VerifiableProperties; //導入方法依賴的package包/類
@Override
public synchronized void init(VerifiableProperties props) {
    if (!initialized) {
        KafkaMetricsConfig metricsConfig = new KafkaMetricsConfig(props);
        graphiteHost = props.getString("kafka.graphite.metrics.host", GRAPHITE_DEFAULT_HOST);
        graphitePort = props.getInt("kafka.graphite.metrics.port", GRAPHITE_DEFAULT_PORT);
        graphiteGroupPrefix = props.getString("kafka.graphite.metrics.env", GRAPHITE_DEFAULT_PREFIX);
        
        System.setProperty("kafka.graphite.metrics.log.debug",
                props.getString("kafka.graphite.metrics.log.debug", "false"));
        System.setProperty("zookeeper.connect", props.getString("zookeeper.connect", "localhost:2181"));
        System.setProperty("kafka.http.status.port", props.getString("kafka.http.status.port", "6091"));
        System.setProperty("kafka.http.status.port", props.getString("kafka.http.status.port", "6091"));
        System.setProperty("kafka.broker.datacenter", props.getString("kafka.broker.datacenter", "default"));
        System.setProperty("kafka.broker.stats.sender", props.getString("kafka.broker.stats.sender", "false"));
        hostMatch = props.getString("kafka.broker.stats.sender", "");

        try {
            graphiteSuffix = InetAddress.getLocalHost().getHostName().toLowerCase();
            if (graphiteSuffix.contains(".")) {
                String[] parts = graphiteSuffix.split("\\.");
                graphiteSuffix = parts[0];
            }
        } catch (UnknownHostException e1) {
            LOG.error(e1);
        }
        String regex = props.getString("kafka.graphite.metrics.exclude.regex", null);

        LOG.info("Initialize GraphiteReporter [" + graphiteHost + "," + graphitePort + "," + graphiteGroupPrefix + "," + hostMatch + "]");

        if (regex != null) {
            predicate = new RegexMetricPredicate(regex);
        }
        try {
            reporter = new GraphiteReporter(Metrics.defaultRegistry(), graphiteHost, graphitePort, graphiteGroupPrefix,
                    graphiteSuffix
            );
        } catch (IOException e) {
            LOG.error("Unable to initialize GraphiteReporter", e);
        }
        if (props.getBoolean("kafka.graphite.metrics.reporter.enabled", false)) {
            initialized = true;
            startReporter(metricsConfig.pollingIntervalSecs());
            LOG.debug("GraphiteReporter started.");
        }
    }
}
 
開發者ID:krux,項目名稱:kafka-metrics-reporter,代碼行數:48,代碼來源:KafkaGraphiteMetricsReporter.java


注:本文中的kafka.utils.VerifiableProperties.getBoolean方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。