Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](api) make QueryDetailQueue.queryCapacity configurable #44990

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2464,6 +2464,12 @@ public class Config extends ConfigBase {
})
public static int http_load_submitter_max_worker_threads = 2;

@ConfField(mutable = false, masterOnly = false, description = {
"缓存的最大Query数量,用于响应http请求/api/query_detail。",
"The max capacity of queries for query_detail api."
})
public static int http_query_detail_capacity = 10000;

@ConfField(mutable = true, masterOnly = true, description = {
"load label个数阈值,超过该个数后,对于已经完成导入作业或者任务,"
+ "其label会被删除,被删除的 label 可以被重用。 值为 -1 时,表示此阈值不生效。",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package org.apache.doris.qe;

import org.apache.doris.common.Config;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;

Expand All @@ -31,9 +33,12 @@
public class QueryDetailQueue {
private static Map<String, QueryDetail> runningQueries = Maps.newHashMap();
private static LinkedList<QueryDetail> totalQueries = new LinkedList<QueryDetail>();
private static int queryCapacity = 10000;
private static int queryCapacity = Config.http_query_detail_capacity;

public static synchronized void addOrUpdateQueryDetail(QueryDetail queryDetail) {
if (queryCapacity <= 0) {
return;
}
if (runningQueries.get(queryDetail.getQueryId()) == null) {
if (queryDetail.getState() == QueryDetail.QueryMemState.RUNNING) {
runningQueries.put(queryDetail.getQueryId(), queryDetail);
Expand Down
Loading