Skip to content

Commit 5a4fad0

Browse files
committed
Revert "datachecker 支持 qualitis v4"
This reverts commit cc56750.
1 parent 14985b2 commit 5a4fad0

File tree

1 file changed

+5
-38
lines changed
  • dss-appconn/appconns/dss-datachecker-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/datachecker/connector

1 file changed

+5
-38
lines changed

dss-appconn/appconns/dss-datachecker-appconn/src/main/java/com/webank/wedatasphere/dss/appconn/datachecker/connector/DataCheckerDao.java

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public boolean validateTableStatusFunction(Properties props, Logger log, RefExec
135135
.parallelStream()
136136
.map(proObjectMap -> {
137137
log.info("Begin to Check dataObject:" + proObjectMap.entrySet().toString());
138-
boolean checkRes = getDataCheckResult(proObjectMap, jobConn, bdpConn, dopsConn, props, log,action,qualitisUtil);
138+
boolean checkRes = getDataCheckResult(proObjectMap, jobConn, bdpConn, dopsConn, props, log,qualitisUtil);
139139
if (null != action.getExecutionRequestRefContext()) {
140140
if (checkRes) {
141141
action.getExecutionRequestRefContext().appendLog("Database table partition info : " + proObjectMap.get(DataChecker.DATA_OBJECT) + " has arrived");
@@ -176,7 +176,6 @@ private boolean getDataCheckResult(Map<String, String> proObjectMap,
176176
Connection dopsConn,
177177
Properties props,
178178
Logger log,
179-
RefExecutionAction action,
180179
QualitisUtil qualitisUtil ) {
181180
String dataObjectStr = proObjectMap.get(DataChecker.DATA_OBJECT) == null ? "" : proObjectMap.get(DataChecker.DATA_OBJECT);
182181
if (StringUtils.isNotBlank(dataObjectStr)) {
@@ -207,31 +206,19 @@ private boolean getDataCheckResult(Map<String, String> proObjectMap,
207206
Predicate<Map<String, String>> isCheckMask = (hasDataSource.and(isBdpDataSource)).or(hasNotDataSource.and(isOdsDB));
208207
boolean normalCheck;
209208
if (isCheckMetadata.test(proObjectMap)) {
210-
if (null != action.getExecutionRequestRefContext()){
211-
action.getExecutionRequestRefContext().appendLog("start to check hive meta");
212-
}
213209
proObjectMap.put(DataChecker.SOURCE_TYPE, HIVE_SOURCE_TYPE);
214210
normalCheck= getJobTotalCount(dataObject, jobConn, log) > 0;
215-
if (null != action.getExecutionRequestRefContext()){
216-
action.getExecutionRequestRefContext().appendLog("check hive meta end,check result:"+normalCheck);
217-
}
218211

219212
} else {
220213
if (isCheckMask.test(proObjectMap)) {
221-
if (null != action.getExecutionRequestRefContext()){
222-
action.getExecutionRequestRefContext().appendLog("start to check maskis");
223-
}
224214
proObjectMap.put(DataChecker.SOURCE_TYPE, MASK_SOURCE_TYPE);
225215
normalCheck= (getBdpTotalCount(dataObject, bdpConn, log, props) > 0 || "success".equals(fetchMaskCode(dataObject, log, props).get("maskStatus")));
226-
if (null != action.getExecutionRequestRefContext()){
227-
action.getExecutionRequestRefContext().appendLog("check maskis end,check result:"+normalCheck);
228-
}
229216
}else {
230217
normalCheck = false;
231218
}
232219
}
233220
return normalCheck
234-
&& checkQualitisData( objectNum,dataObject, log, action, props, dopsConn,qualitisUtil);
221+
&& checkQualitisData( objectNum,dataObject, log, props, dopsConn,qualitisUtil);
235222

236223
}
237224

@@ -452,18 +439,13 @@ private int checkDops(CheckDataObject dataObject, Connection conn, Logger log){
452439
/**
453440
* 从qualitis去check数据
454441
*/
455-
private boolean checkQualitisData(String objectNum,CheckDataObject dataObject, Logger log, RefExecutionAction action,Properties props,Connection conn, QualitisUtil qualitisUtil) {
442+
private boolean checkQualitisData(String objectNum,CheckDataObject dataObject, Logger log, Properties props,Connection conn, QualitisUtil qualitisUtil) {
456443
boolean systemCheck = Boolean.valueOf(props.getProperty(DataChecker.QUALITIS_SWITCH));
457444
String userCheckDefault=props.getProperty(DataChecker.QUALITIS_CHECK_DEFAULT);
458445
boolean userCheck = Boolean.valueOf(props.getProperty(DataChecker.QUALITIS_CHECK, userCheckDefault));
459446
if (systemCheck && userCheck ) {
460-
if (null != action.getExecutionRequestRefContext()){
461-
action.getExecutionRequestRefContext().appendLog("start to check dops");
462-
}
447+
463448
int dopsState=checkDops(dataObject,conn,log);
464-
if (null != action.getExecutionRequestRefContext()){
465-
action.getExecutionRequestRefContext().appendLog("check dops end,check result:"+dopsState);
466-
}
467449
if(dopsState==0){
468450
//没找到记录,直接通过校验
469451
return true;
@@ -472,9 +454,6 @@ private boolean checkQualitisData(String objectNum,CheckDataObject dataObject, L
472454
return false;
473455
}
474456
// 其他情况,继续走qualitis校验
475-
if (null != action.getExecutionRequestRefContext()){
476-
action.getExecutionRequestRefContext().appendLog("start to check qualitis");
477-
}
478457
log.info(
479458
"=============================Data Check Qualitis Start==========================================");
480459
try {
@@ -487,7 +466,7 @@ private boolean checkQualitisData(String objectNum,CheckDataObject dataObject, L
487466
String applicationId = qualitisUtil
488467
.createAndSubmitRule(dataObject,projectName,ruleName,user);
489468
if (StringUtils.isEmpty(applicationId)) {
490-
throw new SQLException("applicationId is empty");
469+
return false;
491470
}
492471
long startTime = System.currentTimeMillis();
493472
while (System.currentTimeMillis() - startTime < Integer
@@ -506,28 +485,16 @@ private boolean checkQualitisData(String objectNum,CheckDataObject dataObject, L
506485
}
507486
break;
508487
case 4:
509-
if (null != action.getExecutionRequestRefContext()){
510-
action.getExecutionRequestRefContext().appendLog("check qualitis end,check result:true");
511-
}
512488
return true;
513489
default:
514-
if (null != action.getExecutionRequestRefContext()){
515-
action.getExecutionRequestRefContext().appendLog("check qualitis end,check result:false");
516-
}
517490
return false;
518491
}
519492

520493
}
521-
if (null != action.getExecutionRequestRefContext()){
522-
action.getExecutionRequestRefContext().appendLog("check qualitis time out,check result set to false");
523-
}
524494
log.info(
525495
"=============================Data Check Qualitis time out==========================================");
526496
return false;
527497
} catch (Exception e) {
528-
if (null != action.getExecutionRequestRefContext()){
529-
action.getExecutionRequestRefContext().appendLog("check qualitis failed,check result set to false.cause by:"+e.getMessage());
530-
}
531498
log.error("get datachecker result from qualitis failed", e);
532499
return false;
533500
}

0 commit comments

Comments
 (0)