Azkaban的Web Server源码探究系列24: 一次性执行execute任务取出处理

提交以后,很不幸,有个问题以下:web

抓包分析:ajax

请求和响应分别以下:app

因此接下来须要对这个URL进行debugwebapp

==============================================================================fetch

GET /executor?execid=6&ajax=fetchexecflowspa

stop in azkaban.webapp.servlet.ExecutorServlet.doGet线程

stop in  azkaban.webapp.servlet.ExecutorServlet.ajaxFetchExecutableFlowdebug

runcode

==============================================================================ci

通过研究,发现这样的行为

看来是须要跟踪QueueProcessorThread了。


stop  in  azkaban.executor.ExecutorManager$QueueProcessorThread.run

stop in azkaban.executor.ExecutorManager$QueueProcessorThread.handle


这个线程执行的是

selectExecutorAndDispatchFlow(reference, exflow, new HashSet<Executor>(activeExecutors));

往下就是:

Executor selectedExecutor = selectExecutor(exflow, availableExecutors);

//用户若是指定了executor,就导向对应的executor

Executor choosenExecutor = getUserSpecifiedExecutor(exflow.getExecutionOptions(), exflow.getExecutionId());

// 

// If no executor was specified by admin

if (choosenExecutor == null) {//不然的话

ExecutorSelector selector = new ExecutorSelector(filterList, comparatorWeightsMap);

choosenExecutor = selector.getBest(availableExecutors, exflow);

}

return choosenExecutor;

那么,究竟是如何选出来的呢?

若是没有指定comparator的话,就是基于executor自身的hashcode来算的,蛋疼!

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

好,下一个问题就是任务如何发到指定的executor上呢?

欲知后事,且听下回分解!

相关文章
相关标签/搜索