logplus/Workflow/WFEngine/WorkflowEngine/include/WorkflowTool.h
2026-01-16 17:18:41 +08:00

55 lines
1.6 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @file WorkflowTool.h
* @brief 工作流辅助工具(支持脚本生成jar submit)
* @author huojidong
*/
#ifndef PAI_HOME_WORKFLOWENGINE_WORKFLOWTOOLS_H
#define PAI_HOME_WORKFLOWENGINE_WORKFLOWTOOLS_H
#include <string>
namespace pai {
namespace workflow {
class CWorkflowTool
{
public:
CWorkflowTool();
~CWorkflowTool();
public:
/**
* @brief 生成一个jar包
* @param jsonfilepath 传入的json路径绝对路径
* @param jarfilename 输入的jar包文件名(可以不填)
*/
bool GenerateJarFile(const std::string &jsonfilepath,const std::string&jarfilename,const std::string &destjarpath);
/**
* @brief 得到要存放Jar包文件路径
*/
std::string GetDestJarPath()const {return destJarPath;}
/**
* @brief 设置要存放Jar包的路径
*/
void SetDestJarPath(std::string inputJarPath){inputJarPath.append("/");destJarPath=inputJarPath;}
private:
/**
*@brief 将json文件拷贝到临时目录的之下吻合compiler下的GeneratorJobFile函数
*@param strFilePath json路径
*@param strCompileTmpDir 临时文件夹路径
*/
bool SaveJsonToLocalCompileTmp(const std::string& strFilePath,const std::string& strCompileTmpDir);
/**
*@brief 将生成的jar文件拷贝到PAI_HOME下的res目录下脚本执行的当前目录
*@param strCompileTmpDir 临时目录
*@param jarfilename 目标jar包文件名
*@param jardestpath jar包存储路径
*/
bool CopyJarFileToDestFilePath(const std::string&strCompileTmpDir,const std::string& jarfilename);
private:
std::string destJarPath;//目标路径地址
};
}
}
#endif