|
@@ -42,6 +42,9 @@ public class Main {
|
|
static {
|
|
static {
|
|
options.addOption("q", "query", false, "选填,查询昨天company增量表是否有数据");
|
|
options.addOption("q", "query", false, "选填,查询昨天company增量表是否有数据");
|
|
options.addOption("d", "debug", false, "选填,启用debug模式,只输出任务参数不进行调度");
|
|
options.addOption("d", "debug", false, "选填,启用debug模式,只输出任务参数不进行调度");
|
|
|
|
+ options.addOption("w", "wait", false, "选填,等待上游数据同步完成");
|
|
|
|
+
|
|
|
|
+
|
|
options.addOption("s", "singleJob", false, "选填,是否单独触发一个业务流程");
|
|
options.addOption("s", "singleJob", false, "选填,是否单独触发一个业务流程");
|
|
options.addOption("b", "bizDate", true, "选填,业务时间[2020-07-07],默认为昨天");
|
|
options.addOption("b", "bizDate", true, "选填,业务时间[2020-07-07],默认为昨天");
|
|
options.addOption("f", "fileName", true, "必填,yaml文件");
|
|
options.addOption("f", "fileName", true, "必填,yaml文件");
|
|
@@ -74,12 +77,13 @@ public class Main {
|
|
CommandLineParser parser = new DefaultParser();
|
|
CommandLineParser parser = new DefaultParser();
|
|
try {
|
|
try {
|
|
CommandLine commandLine = parser.parse(options, args);
|
|
CommandLine commandLine = parser.parse(options, args);
|
|
|
|
+
|
|
if (commandLine.hasOption("q")) {
|
|
if (commandLine.hasOption("q")) {
|
|
OdpsService bean = context.getBean(OdpsService.class);
|
|
OdpsService bean = context.getBean(OdpsService.class);
|
|
String ds = DateUtils.getYesterday().replace("-", "");
|
|
String ds = DateUtils.getYesterday().replace("-", "");
|
|
- List<String> emptyTable = bean.getEmptyTable(ds);
|
|
|
|
- HashSet<String> set = new HashSet<>(emptyTable);
|
|
|
|
- if (set.contains("company")) {
|
|
|
|
|
|
+ List<String> notEmptyTable = bean.getNotEmptyTable(ds);
|
|
|
|
+ HashSet<String> set = new HashSet<>(notEmptyTable);
|
|
|
|
+ if (!set.contains("company")) {
|
|
log.error("company表{}分区数据为空,调度程序中止!", ds);
|
|
log.error("company表{}分区数据为空,调度程序中止!", ds);
|
|
dd.send("company表" + ds + "分区数据为空,调度程序中止!");
|
|
dd.send("company表" + ds + "分区数据为空,调度程序中止!");
|
|
System.exit(-1);
|
|
System.exit(-1);
|
|
@@ -88,6 +92,13 @@ public class Main {
|
|
}
|
|
}
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (commandLine.hasOption("w")) {
|
|
|
|
+ QueryStatus bean = context.getBean(QueryStatus.class);
|
|
|
|
+ bean.waitTaskDone();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
verify(commandLine);
|
|
verify(commandLine);
|
|
String bizDate = commandLine.getOptionValue("b", DateUtils.getYesterday());
|
|
String bizDate = commandLine.getOptionValue("b", DateUtils.getYesterday());
|
|
String fileName = commandLine.getOptionValue("f");
|
|
String fileName = commandLine.getOptionValue("f");
|