Search in sources :

Example 1 with SchemaEvaluator

use of org.talend.dq.indicators.SchemaEvaluator in project tdq-studio-se by Talend.

the class SchemaAnalysisExecutor method evaluate.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.dq.analysis.AnalysisExecutor#runAnalysis(org.talend.dataquality.analysis.Analysis,
     * java.lang.String)
     */
@Override
protected ReturnCode evaluate(Analysis analysis, java.sql.Connection connection, String sqlStatement) {
    SchemaEvaluator eval = new SchemaEvaluator();
    // MOD xqliu 2009-02-09 bug 6237
    eval.setMonitor(getMonitor());
    // // --- add indicators
    EList<Indicator> indicators = analysis.getResults().getIndicators();
    for (Indicator indicator : indicators) {
        ModelElement analyzedElement = indicator.getAnalyzedElement();
        if (analyzedElement == null) {
            continue;
        }
        Schema cat = SwitchHelpers.SCHEMA_SWITCH.doSwitch(analyzedElement);
        if (cat == null) {
            continue;
        }
        eval.storeIndicator(cat, indicator);
        // ADDED rli 2008-07-10 fixed for the SchemaIndicator will increased after connection analysis running.
        indicator.reset();
    }
    if (getMonitor() != null) {
        getMonitor().worked(compIndicatorsWorked);
    }
    ReturnCode retCode = runAnalysisLow(analysis, sqlStatement, eval, connection);
    return retCode;
}
Also used : ModelElement(orgomg.cwm.objectmodel.core.ModelElement) ReturnCode(org.talend.utils.sugars.ReturnCode) Schema(orgomg.cwm.resource.relational.Schema) SchemaEvaluator(org.talend.dq.indicators.SchemaEvaluator) Indicator(org.talend.dataquality.indicators.Indicator)

Aggregations

Indicator (org.talend.dataquality.indicators.Indicator)1 SchemaEvaluator (org.talend.dq.indicators.SchemaEvaluator)1 ReturnCode (org.talend.utils.sugars.ReturnCode)1 ModelElement (orgomg.cwm.objectmodel.core.ModelElement)1 Schema (orgomg.cwm.resource.relational.Schema)1