yiguolei commented on code in PR #35110: URL: https://github.com/apache/doris/pull/35110#discussion_r1609192743
########## fe/fe-core/src/main/java/org/apache/doris/common/util/ProfileManager.java: ########## @@ -326,28 +328,72 @@ private static TGetRealtimeExecStatusResponse getRealtimeQueryProfile( return resp; } - public String getProfile(String queryID) { - TUniqueId thriftQueryId = Util.parseTUniqueIdFromString(queryID); - List<TNetworkAddress> involvedBackends = null; - if (thriftQueryId != null) { - CoordInterface coor = QeProcessorImpl.INSTANCE.getCoordinator(thriftQueryId); - if (coor != null) { - involvedBackends = coor.getInvolvedBackends(); - } + private List<Future<TGetRealtimeExecStatusResponse>> createFetchRealTimeProfileTasks(String id) { + // For query, id is queryId, for load, id is LoadLoadingTaskId + class QueryIdAndAddress { + public TUniqueId id; + public TNetworkAddress beAddress; } List<Future<TGetRealtimeExecStatusResponse>> futures = Lists.newArrayList(); + TUniqueId queryId = Util.parseTUniqueIdFromString(id); + List<QueryIdAndAddress> involvedBackends = Lists.newArrayList(); + + if (queryId != null) { + CoordInterface coor = QeProcessorImpl.INSTANCE.getCoordinator(queryId); - if (involvedBackends != null) { - for (TNetworkAddress beAddress : involvedBackends) { - Callable<TGetRealtimeExecStatusResponse> task = () -> { - return getRealtimeQueryProfile(thriftQueryId, beAddress); - }; - Future<TGetRealtimeExecStatusResponse> future = fetchRealTimeProfileExecutor.submit(task); - futures.add(future); + if (coor != null) { + for (TNetworkAddress addr : coor.getInvolvedBackends()) { + QueryIdAndAddress tmp = new QueryIdAndAddress(); + tmp.id = queryId; + tmp.beAddress = addr; + involvedBackends.add(tmp); + } } + } else { + Long loadJobId = (long) -1; + try { + loadJobId = Long.parseLong(id); + } catch (Exception e) { + return futures; Review Comment: 在java 里,遇到错误直接抛异常。不要返回这种invalid的值。 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org