Azkaban的Exec Server分析 27:Execute Server接收任务的过程分析

以前,咱们说过,web server分发任务,是经过以下的URL来的java

uri = "http://x.x.x.x:port/executor?action=execute&execid=12&user"

// 构造URIweb

URI uri = ExecutorApiClient.buildUri(hostportpathtrueparamList.toArray(new Pair[0])); 数据库

return apiclient.httpGet(urinull);api

也就是说,web server发出这样的GET请求给execute server,那么下面就来分析execute server是如何处理这个链接的!app

========================================================================================ui

root.addServlet(new ServletHolder(new ExecutorServlet()), "/executor");spa

========================================================================================线程

jdb azkaban.execapp.AzkabanExecutorServer  -conf  /root/azkb/azkaban_3.0.0_debug/confdebug

stop in azkaban.execapp.ExecutorServlet.init
code

stop in azkaban.execapp.ExecutorServlet.doGet

stop in azkaban.execapp.FlowRunnerManager.submitFlow

run

========================================================================================

private void handleAjaxExecute(HttpServletRequest req, Map<String, Object> respMap, int execId)

throws ServletException {

// 看到这里了

try {

// 交给本地的manager来处理

flowRunnerManager.submitFlow(execId);

} catch (ExecutorManagerException e) {

e.printStackTrace();

logger.error(e);

respMap.put(RESPONSE_ERROR, e.getMessage());

}

}


先从数据库中执行以下语句:

private static String FETCH_EXECUTABLE_FLOW = "SELECT exec_id, enc_type, flow_data FROM execution_flows "

+ "WHERE exec_id=?";

查处flowData后,-》取出projectId,+Version.

而后以此去查ProjectVersions获得数据

再去project_files拿下数据。

其实你知道是拿下了你上传的压缩包就好了,而后解压缩到本地的projects文件夹中!

========================================================================

这期间会建立一个软链接

ln -s /root/azkb/azkaban_3.0.0_debug/projects/9.15/* .;

实际效果以下:

=================================================================================

Future<?> future = executorService.submit(runner);

 

提交任务入执行线程池!

相关文章
相关标签/搜索