FragmentStarter 主要进行FragmentExecutor的启动管理
Fragment 执行简单说明
dremio 对于Fragment的执行与apache drill 是一致的,会包含root,中间,以及leaf,同时Fragment 会包含
major 以及 minor fragments,每个fragment 会包含不少operator,每个fragment 的执行是由单线程处理的
fragment 是术语上的,FragmentExecutor 是对于fragment pipeline 的处理(此处dremio 包含了一个pipeline的处理)
major 实际上是一个逻辑名称实际干活的是minor,root 的核心是获取查询,读取表的元数据,重写查询以及路由到下一
层同时也会返回数据给客户端应用 ,中间层在数据可用以及从其他fragment 来数据的时候进行工作,同时也会传递查询结
果数据到root 中,leaf(并行扫描处理存储的)的部分数据会传递到中间中,中间Fragment 会并行进行操作
备注:以上部分与google Dremel 基本一致的
参加执行
- FragmentStarter
FragmentStarter 调用链如下,实际上是有客户端发起然后,通过dremio的ForemenWorkManager 处理的,当然内部还包含了job 处理
Press Q or Ctrl+C to abort.
Affect(class count: 1 , method count: 1) cost in 401 ms, listenerId: 2
ts=2023-01-11 12:49:00;thread_name=1c414fc3-29fd-3908-1ffc-dcd05a09d700:foreman;id=33c;is_daemon=true;priority=10;TCCL=sun.misc.Launcher$AppClassLoader@18b4aac2
@com.dremio.exec.maestro.FragmentStarter.start()
at com.dremio.exec.maestro.QueryTrackerImpl.startFragments(QueryTrackerImpl.java:151)
at com.dremio.exec.maestro.MaestroServiceImpl.executeQuery(MaestroServiceImpl.java:176)
at com.dremio.exec.work.foreman.AttemptManager.run(AttemptManager.java:414)
at com.jprofiler.agent.callee.RunnableTracking.run(ejt:19)
at com.dremio.context.RequestContext.run(RequestContext.java:96)
at com.dremio.common.concurrent.ContextMigratingExecutorService.lambda$decorate$3(ContextMigratingExecutorService.java:199)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
- FragmentExecutor
说明
以上只是简单的介绍了FragmentStarter 部分,实际可以多看源码学习
参考资料
sabot/kernel/src/main/java/com/dremio/exec/maestro/QueryTrackerImpl.java
sabot/kernel/src/main/java/com/dremio/exec/maestro/FragmentStarter.java
sabot/kernel/src/main/java/com/dremio/sabot/driver/PipelineCreator.java
sabot/kernel/src/main/java/com/dremio/sabot/exec/FragmentWorkManager.java
sabot/kernel/src/main/java/com/dremio/sabot/exec/fragment/FragmentExecutor.java
sabot/kernel/src/test/java/com/dremio/exec/maestro/TestFragmentTracker.java
sabot/kernel/src/test/java/com/dremio/sabot/exec/fragment/TestFragmentExecutor.java
sabot/kernel/src/test/java/com/dremio/sabot/exec/TestFragmentExecutors.java
sabot/kernel/src/main/java/com/dremio/exec/planner/fragment/SimpleParallelizer.java
sabot/kernel/src/main/java/com/dremio/exec/planner/fragment/PlanFragmentFull.java
sabot/kernel/src/main/java/com/dremio/exec/maestro/QueryTrackerImpl.java
sabot/kernel/src/main/java/com/dremio/exec/work/protector/Foreman.java
services/jobs/src/main/java/com/dremio/service/jobs/LocalJobsService.java
https://panoply.io/data-warehouse-guide/bigquery-architecture/
https://drill.apache.org/docs/drill-query-execution/
https://cloud.google.com/blog/products/data-analytics/new-blog-series-bigquery-explained-overview