|
@@ -4,6 +4,7 @@ package com.gyee.impala.service.master.diagnose;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.gyee.impala.common.config.GyeeConfig;
|
|
|
import com.gyee.impala.common.config.jsch.JSchConfig;
|
|
|
+import com.gyee.impala.common.util.DateUtil;
|
|
|
import com.gyee.impala.common.util.JudeSystem;
|
|
|
import com.gyee.impala.model.master.diagnose.Diagnosetrainhistory;
|
|
|
import com.gyee.impala.model.master.diagnose.TrainInfo;
|
|
@@ -69,7 +70,7 @@ public class TrainFileModeService {
|
|
|
//文件路径
|
|
|
String filePath = config.getPath() + file.getOriginalFilename();
|
|
|
|
|
|
- System.out.println(new Date() + "开始执行脚本...");
|
|
|
+ System.out.println(DateUtil.getCurrentDate() + "开始执行脚本"+(isComplete)+"...");
|
|
|
Process p;
|
|
|
String cmdPath = gyeeConfig.getDiagnosePath();
|
|
|
String inst = JudeSystem.isWindows() ? "cmd" : "/bin/sh";
|
|
@@ -89,8 +90,6 @@ public class TrainFileModeService {
|
|
|
}
|
|
|
if (se != null) {
|
|
|
System.err.println(se);
|
|
|
- TrainInfo t = JSONObject.parseObject(se, TrainInfo.class);
|
|
|
- produce(t);
|
|
|
}
|
|
|
}
|
|
|
p.waitFor();
|
|
@@ -101,7 +100,8 @@ public class TrainFileModeService {
|
|
|
isComplete = true;
|
|
|
}
|
|
|
|
|
|
- System.out.println(new Date() + "脚本执行结束...");
|
|
|
+
|
|
|
+ System.out.println(DateUtil.getCurrentDate()+ "脚本执行结束"+(isComplete)+"...");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -110,7 +110,7 @@ public class TrainFileModeService {
|
|
|
// put 控制台信息到队列中
|
|
|
// trainInfo.setComplete(trainInfo.getComplete() ? trainInfo.isComplete() : isComplete);
|
|
|
|
|
|
- System.out.println("add log =["+trainInfo.getLog()+"] time = ["+trainInfo.getTime()+"] complete = ["+isComplete+"]");
|
|
|
+ System.out.println("add log =["+trainInfo.getLog()+"] time = ["+trainInfo.getTime()+"] complete = ["+trainInfo.getComplete()+"]");
|
|
|
infoQueue.put(trainInfo);
|
|
|
}
|
|
|
|