本文整理匯總了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.");
}
}
}
示例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.");
}
}
}
示例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.");
}
}
}
示例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);
}
示例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.");
}
}
}
示例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);
}
}
示例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.");
}
}
}