/** * @file ModuleContext.h * @brief 文件定义了ModuleContext以及与之相关的TaskInfo * @author 黄军 * @date 2011-12-14 */ #ifndef PAI_FRAME_MODULEAPI_MODULECONTEXT_H #define PAI_FRAME_MODULEAPI_MODULECONTEXT_H #include namespace pai { namespace module { /** * @brief MapReduce任务信息 */ struct TaskInfo { std::string job_id; /**< 作业的HadoopJobId */ std::string attempt_id; /**< 作业Task的attempt_id */ std::string hostname; /**< 运行当前Task的主机名 */ TaskInfo():job_id(""),attempt_id(""),hostname(""){} }; /** * @brief 模块运行时上下文信息 */ struct SModuleContext { int module_sort_id; /**< 工作流中的执行序号 */ int module_indegree; /**< 模块的输入口连接的模块数 */ int module_outdegree; /**< 模块的输出口连接的模块数 */ std::string module_runtime_id; /**< 模块运行时ID */ std::string module_runtime_name; /**< 模块运行时名称(线程名称) */ std::string module_runtime_env; /**< 模块运行时环境描述,请按照[计算节点ip][attemptID]配置 */ TaskInfo taskInfo; /**< 任务信息 */ SModuleContext():module_sort_id(0), module_indegree(0), module_outdegree(0), module_runtime_id(""), module_runtime_name(""), module_runtime_env(""), taskInfo(){} }; } } #endif