This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.1 by this push:
new de6e819db1c branch-4.1: [fix](mtmv) reuse Gson instance in
MTMVTask.getTvfInfo to avoid Master FE CPU spike #66792 (#66845)
de6e819db1c is described below
commit de6e819db1cd37476f03d97265f6623b56384b98
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Aug 20 09:18:39 2026 +0800
branch-4.1: [fix](mtmv) reuse Gson instance in MTMVTask.getTvfInfo to avoid
Master FE CPU spike #66792 (#66845)
Cherry-picked from #66792
Co-authored-by: xy720 <[email protected]>
---
.../main/java/org/apache/doris/job/extensions/mtmv/MTMVTask.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/job/extensions/mtmv/MTMVTask.java
b/fe/fe-core/src/main/java/org/apache/doris/job/extensions/mtmv/MTMVTask.java
index 4904416a267..e71798f21b5 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/job/extensions/mtmv/MTMVTask.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/job/extensions/mtmv/MTMVTask.java
@@ -98,6 +98,8 @@ public class MTMVTask extends AbstractTask {
private static final Logger LOG = LogManager.getLogger(MTMVTask.class);
public static final int DEFAULT_REFRESH_PARTITION_NUM = 1;
+ private static final Gson GSON = new Gson();
+
public static final ImmutableList<Column> SCHEMA = ImmutableList.of(
new Column("TaskId", ScalarType.createStringType()),
new Column("JobId", ScalarType.createStringType()),
@@ -585,16 +587,16 @@ public class MTMVTask extends AbstractTask {
(super.getFinishTimeMs() == null || super.getFinishTimeMs() ==
0) ? FeConstants.null_string
: String.valueOf(super.getFinishTimeMs() -
super.getStartTimeMs())));
trow.addToColumnValue(new TCell()
- .setStringVal(taskContext == null ? FeConstants.null_string :
new Gson().toJson(taskContext)));
+ .setStringVal(taskContext == null ? FeConstants.null_string :
GSON.toJson(taskContext)));
trow.addToColumnValue(
new TCell().setStringVal(refreshMode == null ?
FeConstants.null_string : refreshMode.toString()));
trow.addToColumnValue(
new TCell().setStringVal(
- needRefreshPartitions == null ?
FeConstants.null_string : new Gson().toJson(
+ needRefreshPartitions == null ?
FeConstants.null_string : GSON.toJson(
needRefreshPartitions)));
trow.addToColumnValue(
new TCell().setStringVal(
- completedPartitions == null ? FeConstants.null_string
: new Gson().toJson(
+ completedPartitions == null ? FeConstants.null_string
: GSON.toJson(
completedPartitions)));
trow.addToColumnValue(
new TCell().setStringVal(getProgress()));
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]