|
@@ -0,0 +1,38 @@
|
|
|
|
+package com.tzld.piaoquan.recommend.feature.produce.task;
|
|
|
|
+
|
|
|
|
+import com.tzld.piaoquan.recommend.feature.produce.model.DTSConfig;
|
|
|
|
+import com.tzld.piaoquan.recommend.feature.produce.service.DTSConfigService;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
+
|
|
|
|
+import java.io.IOException;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @author dyp
|
|
|
|
+ */
|
|
|
|
+@Slf4j
|
|
|
|
+public class HourODPSToRedisTask {
|
|
|
|
+ private static String cmd = "spark-submit " +
|
|
|
|
+ " --class com.tzld.piaoquan.recommend.feature.produce.ODPSToRedis" +
|
|
|
|
+ " --master yarn " +
|
|
|
|
+ " --driver-memory 512M" +
|
|
|
|
+ " --executor-memory 512M" +
|
|
|
|
+ " --executor-cores 1" +
|
|
|
|
+ " --num-executors 8 " +
|
|
|
|
+ "recommend-feature-produce.jar" +
|
|
|
|
+ " -project loghubods" +
|
|
|
|
+ " -table alg_vid_feature_all_exp" +
|
|
|
|
+ " -dt `date +\"%Y%m%d\"`" +
|
|
|
|
+ " -hh `date+\"%H\"`" +
|
|
|
|
+ " -env test";
|
|
|
|
+
|
|
|
|
+ public static void main(String[] args) throws IOException {
|
|
|
|
+ String env = "test";
|
|
|
|
+ DTSConfigService dtsConfigService = new DTSConfigService(env);
|
|
|
|
+ List<DTSConfig> configs = dtsConfigService.getAllDTSConfig();
|
|
|
|
+
|
|
|
|
+ Runtime.getRuntime().exec(cmd);
|
|
|
|
+ System.out.println("end");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|