Commit a81df075 by huangfusuper

datax命令支持

parent 0f2dbd02
......@@ -96,6 +96,7 @@ public class ScriptExecutorJobTask implements TimerTask {
String runParam = mythJobTaskSchedule.getRunParam();
//获取命令
String command = mythJobTaskSchedule.getRunCommand();
command = PlaceholderUtils.formatJavaJarCommand(command);
if (!command.startsWith(JAVA_TYPE)) {
command = command.replaceAll(" ","&&");
}
......
......@@ -77,6 +77,19 @@ public class PlaceholderUtils {
}
return sb.toString();
}else{
command = commandDateReplace(param, command);
for (Map.Entry<String, String> stringStringEntry : param.entrySet()) {
String keyName = String.format("${%s}",stringStringEntry.getKey());
command = command.replace(keyName, stringStringEntry.getValue());
}
}
return command;
}
public static String formatJavaJarCommand(String command){
if (command.startsWith(JAVA_TYPE)) {
Pattern p=Pattern.compile(JAVA_JAR_JAR_PATTERN);
Matcher m=p.matcher(command);
......@@ -86,14 +99,9 @@ public class PlaceholderUtils {
String paramSuffix = m.group(3);
command = String.format("java&&-jar&&%s&&%s&&%s",jarName,env,paramSuffix);
}
command = commandDateReplace(param, command);
for (Map.Entry<String, String> stringStringEntry : param.entrySet()) {
String keyName = String.format("${%s}",stringStringEntry.getKey());
command = command.replace(keyName, stringStringEntry.getValue());
}
}
return command;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment