|
@@ -15,6 +15,7 @@ import com.winhc.dataworks.flow.touch.service.SendJobStatus;
|
|
|
import com.winhc.dataworks.flow.touch.service.TouchService;
|
|
|
import com.winhc.dataworks.flow.touch.utils.DateUtils;
|
|
|
import com.winhc.dataworks.flow.touch.utils.DingUtils;
|
|
|
+import com.winhc.dataworks.flow.touch.utils.SmsUtils;
|
|
|
import com.winhc.dataworks.flow.touch.utils.SparkDaemonThread;
|
|
|
import lombok.SneakyThrows;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -41,6 +42,14 @@ public class Main {
|
|
|
private DataWorksAccessProperties dataWorksAccessProperties;
|
|
|
|
|
|
private static final Options options = new Options();
|
|
|
+ @Autowired
|
|
|
+ private SmsUtils smsUtils;
|
|
|
+
|
|
|
+ private static final String[] to = new String[]{
|
|
|
+ "18538736690"
|
|
|
+ , "17602140784"
|
|
|
+
|
|
|
+ };
|
|
|
|
|
|
|
|
|
@Autowired
|
|
@@ -141,11 +150,11 @@ public class Main {
|
|
|
} else {
|
|
|
String odpsCmdPath = commandLine.getOptionValue("odps");
|
|
|
dd.send(msg);
|
|
|
- Long time = 90l;
|
|
|
+ Long time = 120L;
|
|
|
if (fileName.endsWith("step06.yaml")) {
|
|
|
- time = 60 * 6l;
|
|
|
+ time = 60 * 6L;
|
|
|
}
|
|
|
- bean.start(bizDate, jobs, odpsCmdPath, time);
|
|
|
+ bean.start(bizDate, jobs, odpsCmdPath, time, fileName);
|
|
|
// 指定job结束后发送通知
|
|
|
if (fileName.endsWith("step03.yaml")) {
|
|
|
SendJobStatus sendJobStatus = context.getBean(SendJobStatus.class);
|
|
@@ -153,7 +162,6 @@ public class Main {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- System.exit(0);
|
|
|
} catch (ParseException e) {
|
|
|
HelpFormatter formatter = new HelpFormatter();
|
|
|
formatter.printHelp("很棒,参数错误", options);
|
|
@@ -169,7 +177,7 @@ public class Main {
|
|
|
}
|
|
|
|
|
|
@SneakyThrows
|
|
|
- private void start(String bizDate, List<DataWorksFlowJob> jobs, String odpsCmdHome, Long time) {
|
|
|
+ private void start(String bizDate, List<DataWorksFlowJob> jobs, String odpsCmdHome, Long time, String step) {
|
|
|
//为所有项目空间启动守护线程
|
|
|
String accessKeyId = dataWorksAccessProperties.getAccessKeyId();
|
|
|
String accessKeySecret = dataWorksAccessProperties.getAccessKeySecret();
|
|
@@ -209,6 +217,7 @@ public class Main {
|
|
|
failureTask = run(bizDate, js);
|
|
|
}
|
|
|
if (!failureTask.isEmpty()) {
|
|
|
+ smsUtils.send("存在任务重启三次未成功,调度程序已退出。请排查并手动重启调度!【" + step + "】", to);
|
|
|
System.exit(-1);
|
|
|
}
|
|
|
}
|