@Override public void onPolicyChanged(Map<String, T> changed) { if(LOG.isDebugEnabled()) LOG.debug(executorId + ", partition " + partitionSeq + " policy changed : " + changed); for(T alertDef : changed.values()){ if(!accept(alertDef)) continue; LOG.info(executorId + ", partition " + partitionSeq + " policy really changed " + alertDef); synchronized(this.policyEvaluators) { PolicyEvaluator<T> pe = policyEvaluators.get(alertDef.getTags().get(Constants.POLICY_ID)); boolean previousMarkdown = pe.isMarkdownEnabled(); String previousMarkdownReason = pe.getMarkdownReason(); pe.onPolicyUpdate(alertDef); if (isMarkdownUpdateRequired(previousMarkdown, pe.isMarkdownEnabled(), previousMarkdownReason, pe.getMarkdownReason())) updateMarkdownDetails(alertDef, pe.isMarkdownEnabled(), pe.getMarkdownReason()); } } }
String policyId = entry.getKey(); PolicyEvaluator<T> evaluator = entry.getValue(); if (!evaluator.isMarkdownEnabled()) { // not evaluated for a marked down policy updateCounter(EAGLE_POLICY_EVAL_COUNT, getDimensions(policyId)); try {
.getConstructor(Config.class, PolicyEvaluationContext.class, AbstractPolicyDefinition.class, String[].class, boolean.class) .newInstance(config, context, policyDef, sourceStreams, needValidation); if (pe.isMarkdownEnabled()) // updating markdown details only if the policy is found invalid updateMarkdownDetails(alertDef, pe.isMarkdownEnabled(), pe.getMarkdownReason()); } catch(Exception ex) { LOG.error("Fail creating new policyEvaluator", ex);