All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.panhongan.util.kafka.KafkaExporterConfig Maven / Gradle / Ivy

There is a newer version: 0.1.8
Show newest version
package com.github.panhongan.util.kafka;

import com.github.panhongan.util.StringUtil;
import com.github.panhongan.util.conf.Config;

public class KafkaExporterConfig {
	
	private static KafkaExporterConfig instance = new KafkaExporterConfig();

	private Config config = new Config();
	
	public static KafkaExporterConfig getInstance() {
		return instance;
	}
	
	private KafkaExporterConfig() {
	}
	
	public boolean parse(String confFile) {
		return config.parse(confFile);
	}
	
	public Config getConfig() {
		return config;
	}
	
	public boolean isValid() {
		return (!StringUtil.isEmpty(config.getString("kafka.zk.list")) &&
				!StringUtil.isEmpty(config.getString("kafka.broker.list")) &&
				!StringUtil.isEmpty(config.getString("kafka.consumer.group")) &&
				!StringUtil.isEmpty(config.getString("kafka.consumer.group.restart.offset.largest")) &&
				!StringUtil.isEmpty(config.getString("kafka.topic.partition")) &&
				!StringUtil.isEmpty(config.getString("local.data.dir")));
	}
	
	@Override
	public String toString() {
		return config.toString();
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy