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);

 

提交任務入執行線程池!

相關文章
相關標籤/搜索