public void addIntoBlacklist(String topic) { maybeCreateZkPath(_blacklistedTopicsZPath + "/" + topic); LOGGER.info("topic={} is added to blacklist on zk", topic); }
public void start() { registerMetrics(); LOGGER.info("Creating zkpath={} for blacklisted topics", _blacklistedTopicsZPath); maybeCreateZkPath(_blacklistedTopicsZPath); // Report current status every one minutes. LOGGER.info("Trying to schedule auto topic whitelisting job at rate {} {} !", _refreshTimeInSec, _timeUnit.toString()); _executorService.scheduleAtFixedRate(new Runnable() { @Override public void run() { if (_helixMirrorMakerManager.isLeader()) { _numOfAutoWhitelistingRuns.inc(); LOGGER.info("Trying to run topic whitelisting job"); Set<String> candidateTopicsToWhitelist = null; try { candidateTopicsToWhitelist = getCandidateTopicsToWhitelist(); } catch (Exception e) { LOGGER.error("Failed to get candidate topics: ", e); candidateTopicsToWhitelist = new HashSet<String>(); } LOGGER.info("Trying to whitelist topics: {}", Arrays.toString(candidateTopicsToWhitelist.toArray(new String[0]))); _numErrorTopics.dec(_numErrorTopics.getCount()); whitelistCandiateTopics(candidateTopicsToWhitelist); } else { LOGGER.debug("Not leader, skip auto topic whitelisting!"); } } }, Math.min(_initWaitTimeInSec, _refreshTimeInSec), _refreshTimeInSec, _timeUnit); }
public void addIntoBlacklist(String topic) { maybeCreateZkPath(_blacklistedTopicsZPath + "/" + topic); LOGGER.info("topic={} is added to blacklist on zk", topic); }
public void start() { registerMetrics(); LOGGER.info("Creating zkpath={} for blacklisted topics", _blacklistedTopicsZPath); maybeCreateZkPath(_blacklistedTopicsZPath); // Report current status every one minutes. LOGGER.info("Trying to schedule auto topic whitelisting job at rate {} {} !", _refreshTimeInSec, _timeUnit.toString()); _executorService.scheduleAtFixedRate(new Runnable() { @Override public void run() { if (_helixMirrorMakerManager.isLeader()) { _numOfAutoWhitelistingRuns.inc(); LOGGER.info("Trying to run topic whitelisting job"); Set<String> candidateTopicsToWhitelist = null; try { candidateTopicsToWhitelist = getCandidateTopicsToWhitelist(); } catch (Exception e) { LOGGER.error("Failed to get candidate topics: ", e); candidateTopicsToWhitelist = new HashSet<String>(); } LOGGER.info("Trying to whitelist topics: {}", Arrays.toString(candidateTopicsToWhitelist.toArray(new String[0]))); _numErrorTopics.dec(_numErrorTopics.getCount()); whitelistCandiateTopics(candidateTopicsToWhitelist); } else { LOGGER.debug("Not leader, skip auto topic whitelisting!"); } } }, Math.min(_initWaitTimeInSec, _refreshTimeInSec), _refreshTimeInSec, _timeUnit); }