You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by pe...@apache.org on 2022/04/18 13:32:50 UTC
[incubator-linkis] branch dev-1.1.2 updated: refactor jobhistoryConfiguration (#1995)
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.2
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
The following commit(s) were added to refs/heads/dev-1.1.2 by this push:
new fa3b9ad38 refactor jobhistoryConfiguration (#1995)
fa3b9ad38 is described below
commit fa3b9ad38445db920de44d6c2b9538f1c82839f9
Author: legendtkl <ta...@gmail.com>
AuthorDate: Mon Apr 18 21:32:46 2022 +0800
refactor jobhistoryConfiguration (#1995)
---
.../cache/impl/DefaultQueryCacheManager.java | 8 ++++---
.../jobhistory/conf/JobHistoryConfiguration.java | 28 ----------------------
.../jobhistory/conf/JobhistoryConfiguration.scala | 4 ++++
3 files changed, 9 insertions(+), 31 deletions(-)
diff --git a/linkis-public-enhancements/linkis-publicservice/linkis-jobhistory/src/main/java/org/apache/linkis/jobhistory/cache/impl/DefaultQueryCacheManager.java b/linkis-public-enhancements/linkis-publicservice/linkis-jobhistory/src/main/java/org/apache/linkis/jobhistory/cache/impl/DefaultQueryCacheManager.java
index 74501fcf0..32dd1d210 100644
--- a/linkis-public-enhancements/linkis-publicservice/linkis-jobhistory/src/main/java/org/apache/linkis/jobhistory/cache/impl/DefaultQueryCacheManager.java
+++ b/linkis-public-enhancements/linkis-publicservice/linkis-jobhistory/src/main/java/org/apache/linkis/jobhistory/cache/impl/DefaultQueryCacheManager.java
@@ -18,7 +18,7 @@
package org.apache.linkis.jobhistory.cache.impl;
import org.apache.linkis.jobhistory.cache.QueryCacheManager;
-import org.apache.linkis.jobhistory.conf.JobHistoryConfiguration;
+import org.apache.linkis.jobhistory.conf.JobhistoryConfiguration;
import org.apache.linkis.jobhistory.dao.JobHistoryMapper;
import org.apache.linkis.jobhistory.entity.JobHistory;
import org.apache.linkis.jobhistory.util.QueryConfig;
@@ -54,7 +54,9 @@ public class DefaultQueryCacheManager implements QueryCacheManager, Initializing
private Map<String, Cache<String, UserTaskResultCache>> engineUserCaches =
Maps.newConcurrentMap();
- private Long undoneTaskMinId = JobHistoryConfiguration.UNDONE_JOB_MINIMUM_ID.getValue();
+ private Long undoneTaskMinId =
+ Long.valueOf(
+ String.valueOf(JobhistoryConfiguration.UNDONE_JOB_MINIMUM_ID().getValue()));
@Override
public void afterPropertiesSet() throws Exception {
@@ -99,7 +101,7 @@ public class DefaultQueryCacheManager implements QueryCacheManager, Initializing
int minute = 15;
try {
- String refreshTime = JobHistoryConfiguration.UNDONE_JOB_REFRESH_TIME_DAILY.getValue();
+ String refreshTime = JobhistoryConfiguration.UNDONE_JOB_REFRESH_TIME_DAILY().getValue();
String[] parts = refreshTime.split(":");
if (parts.length != 2) {
logger.error(
diff --git a/linkis-public-enhancements/linkis-publicservice/linkis-jobhistory/src/main/java/org/apache/linkis/jobhistory/conf/JobHistoryConfiguration.java b/linkis-public-enhancements/linkis-publicservice/linkis-jobhistory/src/main/java/org/apache/linkis/jobhistory/conf/JobHistoryConfiguration.java
deleted file mode 100644
index 5f588ec77..000000000
--- a/linkis-public-enhancements/linkis-publicservice/linkis-jobhistory/src/main/java/org/apache/linkis/jobhistory/conf/JobHistoryConfiguration.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.jobhistory.conf;
-
-import org.apache.linkis.common.conf.CommonVars;
-
-public class JobHistoryConfiguration {
- public static CommonVars<Long> UNDONE_JOB_MINIMUM_ID =
- CommonVars.apply("wds.linkis.jobhistory.undone.job.minimum.id", 0L);
-
- public static CommonVars<String> UNDONE_JOB_REFRESH_TIME_DAILY =
- CommonVars.apply("wds.linkis.jobhistory.undone.job.refreshtime.daily", "00:15");
-}
diff --git a/linkis-public-enhancements/linkis-publicservice/linkis-jobhistory/src/main/scala/org/apache/linkis/jobhistory/conf/JobhistoryConfiguration.scala b/linkis-public-enhancements/linkis-publicservice/linkis-jobhistory/src/main/scala/org/apache/linkis/jobhistory/conf/JobhistoryConfiguration.scala
index e3fddd13e..14032ed5b 100644
--- a/linkis-public-enhancements/linkis-publicservice/linkis-jobhistory/src/main/scala/org/apache/linkis/jobhistory/conf/JobhistoryConfiguration.scala
+++ b/linkis-public-enhancements/linkis-publicservice/linkis-jobhistory/src/main/scala/org/apache/linkis/jobhistory/conf/JobhistoryConfiguration.scala
@@ -30,4 +30,8 @@ object JobhistoryConfiguration {
val UPDATE_RETRY_TIMES = CommonVars("wds.linkis.jobhistory.update.retry.times", 3)
val UPDATE_RETRY_INTERVAL = CommonVars("wds.linkis.jobhistory.update.retry.interval", 3 * 1000)
+ val UNDONE_JOB_MINIMUM_ID: CommonVars[Long] = CommonVars("wds.linkis.jobhistory.undone.job.minimum.id", 0L)
+
+ val UNDONE_JOB_REFRESH_TIME_DAILY: CommonVars[String] = CommonVars("wds.linkis.jobhistory.undone.job.refreshtime.daily", "00:15")
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org