|
@@ -0,0 +1,55 @@
|
|
|
+package com.winhc.dataworks.flow.touch;
|
|
|
+
|
|
|
+import com.helospark.lightdi.LightDi;
|
|
|
+import com.helospark.lightdi.LightDiContext;
|
|
|
+import com.winhc.dataworks.flow.touch.bean.DataWorksFlowJob;
|
|
|
+import com.winhc.dataworks.flow.touch.configuration.SchemaInit;
|
|
|
+import com.winhc.dataworks.flow.touch.utils.DateUtils;
|
|
|
+import lombok.SneakyThrows;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Author: XuJiakai
|
|
|
+ * @Date: 2020/9/15 17:46
|
|
|
+ * @Description: 批量补数据
|
|
|
+ */
|
|
|
+@Slf4j
|
|
|
+public class BulkSupplementaryDataMain {
|
|
|
+ private static final String file = "D:\\code\\IdeaProjects\\DataWorks-flow-touch\\jobs\\task-step03.yaml";
|
|
|
+
|
|
|
+ @SneakyThrows
|
|
|
+ public static void main(String[] args) {
|
|
|
+ String flow = "company_change_dynamic";
|
|
|
+ String taskName = "company_change_dynamic";
|
|
|
+
|
|
|
+ LightDiContext context = LightDi.initContextByPackage(SingleJobMain.class.getPackage().getName());
|
|
|
+ SingleJobMain bean = context.getBean(SingleJobMain.class);
|
|
|
+ List<DataWorksFlowJob> jobs = SchemaInit.getJobs(file);
|
|
|
+ List<String> bizDates = new ArrayList<>();
|
|
|
+ String bizDate = DateUtils.getMinusDay(29);
|
|
|
+ System.out.println(bizDate);
|
|
|
+ bean.start(flow, taskName, bizDate, jobs);
|
|
|
+// for (int i = 1; i <= 18; i++) {
|
|
|
+// String bizDate = DateUtils.getMinusDay(i);
|
|
|
+// bizDates.add(bizDate);
|
|
|
+// System.out.println(bizDate);
|
|
|
+//// bean.start(flow, taskName, bizDate, jobs);
|
|
|
+// }
|
|
|
+ /* final CountDownLatch count = new CountDownLatch(bizDates.size());
|
|
|
+
|
|
|
+ bizDates.forEach(bizDate -> {
|
|
|
+ Thread thread = new Thread(() -> {
|
|
|
+ bean.start(flow, taskName, bizDate, jobs);
|
|
|
+ log.info(bizDate);
|
|
|
+ count.countDown();
|
|
|
+ });
|
|
|
+ thread.setName("Thread-" + bizDate + ": ");
|
|
|
+ thread.start();
|
|
|
+ });
|
|
|
+ count.await();*/
|
|
|
+ System.out.println("end");
|
|
|
+ }
|
|
|
+}
|