@@ -231,6 +231,17 @@ void MPCService::doRun(const JobInfo& jobInfo)
231231 std::string outResult;
232232 execCommand (mpcCmd, outExitStatus, outResult);
233233
234+ // 4 upload result file
235+ std::string resultFileHdfsPath = jobInfo.outputFilePath ;
236+ std::string resultFileLocalPath = localPathPrefix + MPC_RESULT_FILE;
237+ writeStringToFile (outResult, resultFileLocalPath);
238+
239+ auto resultFileReader =
240+ initialize_lineReader (jobInfo, resultFileLocalPath, DataResourceType::FILE);
241+ auto resultFileWriter =
242+ initialize_lineWriter (jobInfo, resultFileHdfsPath, DataResourceType::HDFS);
243+ readAndSaveFile (resultFileLocalPath, resultFileHdfsPath, resultFileReader, resultFileWriter);
244+
234245 if (outExitStatus != MPC_SUCCESS)
235246 {
236247 MPC_LOG (ERROR) << LOG_DESC (" [MPCService][doRun]" )
@@ -244,17 +255,6 @@ void MPCService::doRun(const JobInfo& jobInfo)
244255 MPC_LOG (INFO) << LOG_DESC (" [MPCService][doRun]" ) << LOG_KV (" jobId" , jobId)
245256 << LOG_DESC (" run mpc job successfully" );
246257
247- // 4 upload result file
248- std::string resultFileHdfsPath = jobInfo.outputFilePath ;
249- std::string resultFileLocalPath = localPathPrefix + MPC_RESULT_FILE;
250- writeStringToFile (outResult, resultFileLocalPath);
251-
252- auto resultFileReader =
253- initialize_lineReader (jobInfo, resultFileLocalPath, DataResourceType::FILE);
254- auto resultFileWriter =
255- initialize_lineWriter (jobInfo, resultFileHdfsPath, DataResourceType::HDFS);
256- readAndSaveFile (resultFileLocalPath, resultFileHdfsPath, resultFileReader, resultFileWriter);
257-
258258 MPC_LOG (INFO) << LOG_DESC (" do run mpc" ) << LOG_KV (" jodId" , jobInfo.jobId )<< LOG_KV (" timecost(ms)" , utcSteadyTime () - startT);
259259}
260260
0 commit comments