[fix](profile) Fix content missing of brokerload profile (#34839)

* Fix compile

* fix style

* [fix](profile) Fix content missing of brokerload profile (#33969)
This commit is contained in:
zhiqiang
2024-05-14 18:56:58 +08:00
committed by GitHub
parent bac51723e8
commit ff22128013
2 changed files with 7 additions and 4 deletions

View File

@ -139,10 +139,12 @@ public class LoadLoadingTask extends LoadTask {
}
private void executeOnce() throws Exception {
final boolean enabelProfile = this.jobProfile != null;
// New one query id,
Coordinator curCoordinator = new Coordinator(callback.getCallbackId(), loadId, planner.getDescTable(),
planner.getFragments(), planner.getScanNodes(), planner.getTimezone(), loadZeroTolerance);
if (this.jobProfile != null) {
planner.getFragments(), planner.getScanNodes(), planner.getTimezone(), loadZeroTolerance,
enabelProfile);
if (enabelProfile) {
this.jobProfile.addExecutionProfile(curCoordinator.getExecutionProfile());
}
curCoordinator.setQueryType(TQueryType.LOAD);

View File

@ -357,12 +357,12 @@ public class Coordinator implements CoordInterface {
nextInstanceId.setLo(queryId.lo + 1);
this.assignedRuntimeFilters = planner.getRuntimeFilters();
this.executionProfile = new ExecutionProfile(queryId, fragments);
}
// Used for broker load task/export task/update coordinator
// Constructor of Coordinator is too complicated.
public Coordinator(Long jobId, TUniqueId queryId, DescriptorTable descTable, List<PlanFragment> fragments,
List<ScanNode> scanNodes, String timezone, boolean loadZeroTolerance) {
List<ScanNode> scanNodes, String timezone, boolean loadZeroTolerance, boolean enableProfile) {
this.isBlockQuery = true;
this.jobId = jobId;
this.queryId = queryId;
@ -370,6 +370,7 @@ public class Coordinator implements CoordInterface {
this.fragments = fragments;
this.scanNodes = scanNodes;
this.queryOptions = new TQueryOptions();
this.queryOptions.setEnableProfile(enableProfile);
this.queryGlobals.setNowString(TimeUtils.DATETIME_FORMAT.format(LocalDateTime.now()));
this.queryGlobals.setTimestampMs(System.currentTimeMillis());
this.queryGlobals.setTimeZone(timezone);