Skip to content

Commit

Permalink
make QueryDetailQueue.queryCapacity configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
cambyzju committed Dec 5, 2024
1 parent 4f0288f commit b6d570b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
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

0 comments on commit b6d570b

Please sign in to comment.