mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-11-29 18:58:05 +08:00
parent
ffc9fb280a
commit
12a6138d33
@ -94,7 +94,7 @@ public class DataQualityResultOperator {
|
|||||||
private void checkDqExecuteResult(TaskEvent taskResponseEvent,
|
private void checkDqExecuteResult(TaskEvent taskResponseEvent,
|
||||||
DqExecuteResult dqExecuteResult,
|
DqExecuteResult dqExecuteResult,
|
||||||
ProcessInstance processInstance) {
|
ProcessInstance processInstance) {
|
||||||
if (isFailure(dqExecuteResult)) {
|
if (isFailed(dqExecuteResult)) {
|
||||||
DqFailureStrategy dqFailureStrategy = DqFailureStrategy.of(dqExecuteResult.getFailureStrategy());
|
DqFailureStrategy dqFailureStrategy = DqFailureStrategy.of(dqExecuteResult.getFailureStrategy());
|
||||||
if (dqFailureStrategy != null) {
|
if (dqFailureStrategy != null) {
|
||||||
dqExecuteResult.setState(DqTaskState.FAILURE.getCode());
|
dqExecuteResult.setState(DqTaskState.FAILURE.getCode());
|
||||||
@ -123,7 +123,7 @@ public class DataQualityResultOperator {
|
|||||||
* @param dqExecuteResult
|
* @param dqExecuteResult
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private boolean isFailure(DqExecuteResult dqExecuteResult) {
|
private boolean isFailed(DqExecuteResult dqExecuteResult) {
|
||||||
CheckType checkType = CheckType.of(dqExecuteResult.getCheckType());
|
CheckType checkType = CheckType.of(dqExecuteResult.getCheckType());
|
||||||
|
|
||||||
double statisticsValue = dqExecuteResult.getStatisticsValue();
|
double statisticsValue = dqExecuteResult.getStatisticsValue();
|
||||||
@ -132,36 +132,36 @@ public class DataQualityResultOperator {
|
|||||||
|
|
||||||
OperatorType operatorType = OperatorType.of(dqExecuteResult.getOperator());
|
OperatorType operatorType = OperatorType.of(dqExecuteResult.getOperator());
|
||||||
|
|
||||||
boolean isFailure = false;
|
boolean isFailed = false;
|
||||||
if (operatorType != null) {
|
if (operatorType != null) {
|
||||||
double srcValue = 0;
|
double srcValue = 0;
|
||||||
switch (checkType) {
|
switch (checkType) {
|
||||||
case COMPARISON_MINUS_STATISTICS:
|
case COMPARISON_MINUS_STATISTICS:
|
||||||
srcValue = comparisonValue - statisticsValue;
|
srcValue = comparisonValue - statisticsValue;
|
||||||
isFailure = getCompareResult(operatorType, srcValue, threshold);
|
isFailed = !getCompareResult(operatorType, srcValue, threshold);
|
||||||
break;
|
break;
|
||||||
case STATISTICS_MINUS_COMPARISON:
|
case STATISTICS_MINUS_COMPARISON:
|
||||||
srcValue = statisticsValue - comparisonValue;
|
srcValue = statisticsValue - comparisonValue;
|
||||||
isFailure = getCompareResult(operatorType, srcValue, threshold);
|
isFailed = !getCompareResult(operatorType, srcValue, threshold);
|
||||||
break;
|
break;
|
||||||
case STATISTICS_COMPARISON_PERCENTAGE:
|
case STATISTICS_COMPARISON_PERCENTAGE:
|
||||||
if (comparisonValue > 0) {
|
if (comparisonValue > 0) {
|
||||||
srcValue = statisticsValue / comparisonValue * 100;
|
srcValue = statisticsValue / comparisonValue * 100;
|
||||||
}
|
}
|
||||||
isFailure = getCompareResult(operatorType, srcValue, threshold);
|
isFailed = !getCompareResult(operatorType, srcValue, threshold);
|
||||||
break;
|
break;
|
||||||
case STATISTICS_COMPARISON_DIFFERENCE_COMPARISON_PERCENTAGE:
|
case STATISTICS_COMPARISON_DIFFERENCE_COMPARISON_PERCENTAGE:
|
||||||
if (comparisonValue > 0) {
|
if (comparisonValue > 0) {
|
||||||
srcValue = Math.abs(comparisonValue - statisticsValue) / comparisonValue * 100;
|
srcValue = Math.abs(comparisonValue - statisticsValue) / comparisonValue * 100;
|
||||||
}
|
}
|
||||||
isFailure = getCompareResult(operatorType, srcValue, threshold);
|
isFailed = !getCompareResult(operatorType, srcValue, threshold);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return isFailure;
|
return isFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendDqTaskResultAlert(DqExecuteResult dqExecuteResult, ProcessInstance processInstance) {
|
private void sendDqTaskResultAlert(DqExecuteResult dqExecuteResult, ProcessInstance processInstance) {
|
||||||
|
Loading…
Reference in New Issue
Block a user