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


Java VerifiableProperties.getInt方法代碼示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: SyncProducerConfig

import kafka.utils.VerifiableProperties; //導入方法依賴的package包/類
public SyncProducerConfig(VerifiableProperties props) {
    super(props);
    host = props.getString("host");
    port = props.getInt("port");
}
 
開發者ID:bingoohuang,項目名稱:buka,代碼行數:6,代碼來源:SyncProducerConfig.java

示例6: KafkaMetricsConfig

import kafka.utils.VerifiableProperties; //導入方法依賴的package包/類
public KafkaMetricsConfig(VerifiableProperties props) {
    this.props = props;

    reporters = Utils.parseCsvList(props.getString("kafka.metrics.reporters", ""));
    pollingIntervalSecs = props.getInt("kafka.metrics.polling.interval.secs", 10);
}
 
開發者ID:bingoohuang,項目名稱:buka,代碼行數:7,代碼來源:KafkaMetricsConfig.java


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