Skip to content

Commit

Permalink
datachecker log add date
Browse files Browse the repository at this point in the history
  • Loading branch information
htyredc committed Nov 21, 2023
1 parent 2ab0f3e commit ef2cd01
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import java.math.BigDecimal;
import java.sql.*;
import java.util.*;
import java.util.Date;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.regex.Matcher;
Expand Down Expand Up @@ -115,7 +116,8 @@ public boolean validateTableStatusFunction(Properties props, Logger log, DataChe

String dataCheckerInfo = props.getProperty(DataChecker.DATA_OBJECT);
if (null != action.getExecutionRequestRefContext()) {
action.getExecutionRequestRefContext().appendLog("=============================Data Check Start==========================================");
Date startCheckDate = new Date();
action.getExecutionRequestRefContext().appendLog(startCheckDate + "=============================Data Check Start==========================================");
// action.getExecutionRequestRefContext().appendLog("Database table partition info : " + dataCheckerInfo);
}
log.info("(DataChecker info) database table partition info : " + dataCheckerInfo);
Expand Down Expand Up @@ -152,20 +154,21 @@ public boolean validateTableStatusFunction(Properties props, Logger log, DataChe
}).collect(Collectors.toList());
boolean flag = allCheckRes.stream().allMatch(res -> res.equals(true));
if (flag) {
Date endCheckDate = new Date();
log.info("=============================Data Check End,check result:true==========================================");
if (null != action.getExecutionRequestRefContext()) {
action.getExecutionRequestRefContext().appendLog("=============================Data Check End,check result:true==========================================");
action.getExecutionRequestRefContext().appendLog(endCheckDate + "=============================Data Check End,check result:true==========================================");
}
return true;
}

} catch (SQLException e) {
throw new RuntimeException("get DataChecker result failed", e);
}

Date endCheckDate = new Date();
log.info("=============================Data Check End,check result:false==========================================");
if (null != action.getExecutionRequestRefContext()) {
action.getExecutionRequestRefContext().appendLog("=============================Data Check End,,check result:false==========================================");
action.getExecutionRequestRefContext().appendLog(endCheckDate + "=============================Data Check End,check result:false==========================================");
}
return false;
}
Expand Down

0 comments on commit ef2cd01

Please sign in to comment.