|
88 | 88 | import org.apache.doris.thrift.TExternalScanRange; |
89 | 89 | import org.apache.doris.thrift.TFileScanRange; |
90 | 90 | import org.apache.doris.thrift.TFileScanRangeParams; |
| 91 | +import org.apache.doris.thrift.THivePartitionUpdate; |
91 | 92 | import org.apache.doris.thrift.TNetworkAddress; |
92 | 93 | import org.apache.doris.thrift.TPaloScanRange; |
93 | 94 | import org.apache.doris.thrift.TPipelineFragmentParams; |
@@ -229,6 +230,9 @@ public class Coordinator implements CoordInterface { |
229 | 230 | private final List<TTabletCommitInfo> commitInfos = Lists.newArrayList(); |
230 | 231 | private final List<TErrorTabletInfo> errorTabletInfos = Lists.newArrayList(); |
231 | 232 |
|
| 233 | + // TODO moved to ExternalTransactionManager |
| 234 | + private final List<THivePartitionUpdate> hivePartitionUpdates = Lists.newArrayList(); |
| 235 | + |
232 | 236 | // Input parameter |
233 | 237 | private long jobId = -1; // job which this task belongs to |
234 | 238 | private TUniqueId queryId; |
@@ -477,6 +481,10 @@ public List<TErrorTabletInfo> getErrorTabletInfos() { |
477 | 481 | return errorTabletInfos; |
478 | 482 | } |
479 | 483 |
|
| 484 | + public List<THivePartitionUpdate> getHivePartitionUpdates() { |
| 485 | + return hivePartitionUpdates; |
| 486 | + } |
| 487 | + |
480 | 488 | public Map<String, Integer> getBeToInstancesNum() { |
481 | 489 | Map<String, Integer> result = Maps.newTreeMap(); |
482 | 490 | if (enablePipelineEngine) { |
@@ -2400,7 +2408,14 @@ private void updateScanRangeNumByScanRange(TScanRangeParams param) { |
2400 | 2408 | // TODO: more ranges? |
2401 | 2409 | } |
2402 | 2410 |
|
2403 | | - |
| 2411 | + private void updateHivePartitionUpdates(List<THivePartitionUpdate> hivePartitionUpdates) { |
| 2412 | + lock.lock(); |
| 2413 | + try { |
| 2414 | + this.hivePartitionUpdates.addAll(hivePartitionUpdates); |
| 2415 | + } finally { |
| 2416 | + lock.unlock(); |
| 2417 | + } |
| 2418 | + } |
2404 | 2419 |
|
2405 | 2420 | // update job progress from BE |
2406 | 2421 | public void updateFragmentExecStatus(TReportExecStatusParams params) { |
@@ -2450,6 +2465,9 @@ public void updateFragmentExecStatus(TReportExecStatusParams params) { |
2450 | 2465 | if (params.isSetErrorTabletInfos()) { |
2451 | 2466 | updateErrorTabletInfos(params.getErrorTabletInfos()); |
2452 | 2467 | } |
| 2468 | + if (params.isSetHivePartitionUpdates()) { |
| 2469 | + updateHivePartitionUpdates(params.getHivePartitionUpdates()); |
| 2470 | + } |
2453 | 2471 |
|
2454 | 2472 | Preconditions.checkArgument(params.isSetDetailedReport()); |
2455 | 2473 | if (ctx.done) { |
@@ -2515,6 +2533,9 @@ public void updateFragmentExecStatus(TReportExecStatusParams params) { |
2515 | 2533 | if (params.isSetErrorTabletInfos()) { |
2516 | 2534 | updateErrorTabletInfos(params.getErrorTabletInfos()); |
2517 | 2535 | } |
| 2536 | + if (params.isSetHivePartitionUpdates()) { |
| 2537 | + updateHivePartitionUpdates(params.getHivePartitionUpdates()); |
| 2538 | + } |
2518 | 2539 | if (LOG.isDebugEnabled()) { |
2519 | 2540 | LOG.debug("Query {} instance {} is marked done", |
2520 | 2541 | DebugUtil.printId(queryId), DebugUtil.printId(params.getFragmentInstanceId())); |
@@ -2592,6 +2613,9 @@ public void updateFragmentExecStatus(TReportExecStatusParams params) { |
2592 | 2613 | if (params.isSetErrorTabletInfos()) { |
2593 | 2614 | updateErrorTabletInfos(params.getErrorTabletInfos()); |
2594 | 2615 | } |
| 2616 | + if (params.isSetHivePartitionUpdates()) { |
| 2617 | + updateHivePartitionUpdates(params.getHivePartitionUpdates()); |
| 2618 | + } |
2595 | 2619 | executionProfile.markOneInstanceDone(params.getFragmentInstanceId()); |
2596 | 2620 | } |
2597 | 2621 | } |
|
0 commit comments