Search in sources :

Example 1 with AssessorNotFoundException

use of com.thinkbiganalytics.metadata.sla.spi.AssessorNotFoundException in project kylo by Teradata.

the class DefaultServiceLevelAgreementChecker method checkAgreement.

/**
 * Check the Agreement. Caller needs to wrap this in MetadataAccesss transcation
 */
public void checkAgreement(ServiceLevelAgreement agreement) {
    if (agreement != null) {
        Alert newAlert = null;
        if (isAssessable(agreement)) {
            LOG.info("Assessing SLA  : " + agreement.getName());
            try {
                ServiceLevelAssessment assessment = assessor.assess(agreement);
                if (shouldAlert(agreement, assessment)) {
                    newAlert = alertManager.createEntityAlert(AssessmentAlerts.VIOLATION_ALERT_TYPE, Alert.Level.FATAL, "Violation of SLA: " + agreement.getName(), alertManager.createEntityIdentificationAlertContent(agreement.getId().toString(), SecurityRole.ENTITY_TYPE.SLA, assessment.getId()));
                }
            } catch (AssessorNotFoundException e) {
                LOG.info("SLA assessment failed.  Assessor Not found: {} - Exception: {}", agreement.getName(), e);
            }
        }
        if (newAlert != null) {
            // Record this assessment as the latest for this SLA.
            alertedAssessments.put(agreement.getId(), (ServiceLevelAssessment.ID) newAlert.getContent());
            LOG.info("SLA assessment failed: {} - generated alert: {}", agreement.getName(), newAlert.getId());
        }
    }
}
Also used : ServiceLevelAssessment(com.thinkbiganalytics.metadata.sla.api.ServiceLevelAssessment) AssessorNotFoundException(com.thinkbiganalytics.metadata.sla.spi.AssessorNotFoundException) Alert(com.thinkbiganalytics.alerts.api.Alert)

Aggregations

Alert (com.thinkbiganalytics.alerts.api.Alert)1 ServiceLevelAssessment (com.thinkbiganalytics.metadata.sla.api.ServiceLevelAssessment)1 AssessorNotFoundException (com.thinkbiganalytics.metadata.sla.spi.AssessorNotFoundException)1