This is an automated email from the ASF dual-hosted git repository.
doleyzi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git
The following commit(s) were added to refs/heads/master by this push:
new 51af984450 [INLONG-11993][Audit] The audit service supports
customizing the cache on and off (#11994)
51af984450 is described below
commit 51af9844509c5fd0f232bb1f6ef1b5f41adfcec6
Author: doleyzi <[email protected]>
AuthorDate: Thu Sep 11 18:41:49 2025 +0800
[INLONG-11993][Audit] The audit service supports customizing the cache on
and off (#11994)
* [INLONG-11993][Audit] The audit service supports customizing the cache on
and off
* [INLONG-11993][Audit] Optimize the stop script for audit proxy
---
.../audit/service/config/ConfigConstants.java | 9 +++++++++
.../inlong/audit/service/node/EtlService.java | 23 +++++++++++++++++++---
inlong-audit/bin/proxy-stop.sh | 9 ++++++++-
3 files changed, 37 insertions(+), 4 deletions(-)
diff --git
a/inlong-audit/audit-service/src/main/java/org/apache/inlong/audit/service/config/ConfigConstants.java
b/inlong-audit/audit-service/src/main/java/org/apache/inlong/audit/service/config/ConfigConstants.java
index b6e813dbe0..49e0a3b0f9 100644
---
a/inlong-audit/audit-service/src/main/java/org/apache/inlong/audit/service/config/ConfigConstants.java
+++
b/inlong-audit/audit-service/src/main/java/org/apache/inlong/audit/service/config/ConfigConstants.java
@@ -113,6 +113,15 @@ public class ConfigConstants {
public static final String KEY_ENABLE_STAT_AUDIT_DAY =
"enable.stat.audit.day";
public static final boolean DEFAULT_ENABLE_STAT_AUDIT_DAY = true;
+ public static final String KEY_ENABLE_STAT_AUDIT_MINUTE_10 =
"enable.stat.audit.minute.10";
+ public static final boolean DEFAULT_ENABLE_STAT_AUDIT_MINUTE_10 = true;
+
+ public static final String KEY_ENABLE_STAT_AUDIT_MINUTE_30 =
"enable.stat.audit.minute.30";
+ public static final boolean DEFAULT_ENABLE_STAT_AUDIT_MINUTE_30 = true;
+
+ public static final String KEY_ENABLE_STAT_AUDIT_HOUR =
"enable.stat.audit.hour";
+ public static final boolean DEFAULT_ENABLE_STAT_AUDIT_HOUR = true;
+
public static final String KEY_AUDIT_SERVICE_PROMETHEUS_PORT =
"audit.service.prometheus.port";
public static final int DEFAULT_AUDIT_SERVICE_PROMETHEUS_PORT = 10084;
public static final String KEY_AUDIT_SERVICE_METRIC_CLASSNAME =
"audit.service.metric.classname";
diff --git
a/inlong-audit/audit-service/src/main/java/org/apache/inlong/audit/service/node/EtlService.java
b/inlong-audit/audit-service/src/main/java/org/apache/inlong/audit/service/node/EtlService.java
index fcf3c5da32..a09a4d6c2b 100644
---
a/inlong-audit/audit-service/src/main/java/org/apache/inlong/audit/service/node/EtlService.java
+++
b/inlong-audit/audit-service/src/main/java/org/apache/inlong/audit/service/node/EtlService.java
@@ -42,11 +42,17 @@ import java.util.List;
import static
org.apache.inlong.audit.service.config.ConfigConstants.DEFAULT_DATA_QUEUE_SIZE;
import static
org.apache.inlong.audit.service.config.ConfigConstants.DEFAULT_ENABLE_STAT_AUDIT_DAY;
+import static
org.apache.inlong.audit.service.config.ConfigConstants.DEFAULT_ENABLE_STAT_AUDIT_HOUR;
+import static
org.apache.inlong.audit.service.config.ConfigConstants.DEFAULT_ENABLE_STAT_AUDIT_MINUTE_10;
+import static
org.apache.inlong.audit.service.config.ConfigConstants.DEFAULT_ENABLE_STAT_AUDIT_MINUTE_30;
import static
org.apache.inlong.audit.service.config.ConfigConstants.DEFAULT_SELECTOR_SERVICE_ID;
import static
org.apache.inlong.audit.service.config.ConfigConstants.DEFAULT_SUMMARY_DAILY_STAT_BACK_TIMES;
import static
org.apache.inlong.audit.service.config.ConfigConstants.DEFAULT_SUMMARY_REALTIME_STAT_BACK_TIMES;
import static
org.apache.inlong.audit.service.config.ConfigConstants.KEY_DATA_QUEUE_SIZE;
import static
org.apache.inlong.audit.service.config.ConfigConstants.KEY_ENABLE_STAT_AUDIT_DAY;
+import static
org.apache.inlong.audit.service.config.ConfigConstants.KEY_ENABLE_STAT_AUDIT_HOUR;
+import static
org.apache.inlong.audit.service.config.ConfigConstants.KEY_ENABLE_STAT_AUDIT_MINUTE_10;
+import static
org.apache.inlong.audit.service.config.ConfigConstants.KEY_ENABLE_STAT_AUDIT_MINUTE_30;
import static
org.apache.inlong.audit.service.config.ConfigConstants.KEY_SELECTOR_SERVICE_ID;
import static
org.apache.inlong.audit.service.config.ConfigConstants.KEY_SUMMARY_DAILY_STAT_BACK_TIMES;
import static
org.apache.inlong.audit.service.config.ConfigConstants.KEY_SUMMARY_REALTIME_STAT_BACK_TIMES;
@@ -86,9 +92,20 @@ public class EtlService {
int statBackTimes =
configuration.get(KEY_SUMMARY_REALTIME_STAT_BACK_TIMES,
DEFAULT_SUMMARY_REALTIME_STAT_BACK_TIMES);
- startDataFlow(AuditCycle.MINUTE_10, statBackTimes,
TenMinutesCache.getInstance().getCache());
- startDataFlow(AuditCycle.MINUTE_30, statBackTimes,
HalfHourCache.getInstance().getCache());
- startDataFlow(AuditCycle.HOUR, statBackTimes,
HourCache.getInstance().getCache());
+ if (configuration.get(KEY_ENABLE_STAT_AUDIT_MINUTE_10,
DEFAULT_ENABLE_STAT_AUDIT_MINUTE_10)) {
+ startDataFlow(AuditCycle.MINUTE_10, statBackTimes,
TenMinutesCache.getInstance().getCache());
+ LOGGER.info("Start data flow for minute 10");
+ }
+
+ if (configuration.get(KEY_ENABLE_STAT_AUDIT_MINUTE_30,
DEFAULT_ENABLE_STAT_AUDIT_MINUTE_30)) {
+ startDataFlow(AuditCycle.MINUTE_30, statBackTimes,
HalfHourCache.getInstance().getCache());
+ LOGGER.info("Start data flow for minute 30");
+ }
+
+ if (configuration.get(KEY_ENABLE_STAT_AUDIT_HOUR,
DEFAULT_ENABLE_STAT_AUDIT_HOUR)) {
+ startDataFlow(AuditCycle.HOUR, statBackTimes,
HourCache.getInstance().getCache());
+ LOGGER.info("Start data flow for hour");
+ }
if (configuration.get(KEY_ENABLE_STAT_AUDIT_DAY,
DEFAULT_ENABLE_STAT_AUDIT_DAY)) {
statBackTimes =
configuration.get(KEY_SUMMARY_DAILY_STAT_BACK_TIMES,
DEFAULT_SUMMARY_DAILY_STAT_BACK_TIMES);
diff --git a/inlong-audit/bin/proxy-stop.sh b/inlong-audit/bin/proxy-stop.sh
index 4e24743ad4..90aa5aa769 100644
--- a/inlong-audit/bin/proxy-stop.sh
+++ b/inlong-audit/bin/proxy-stop.sh
@@ -20,4 +20,11 @@
#
# this program kills the audit
-ps -ef | grep "org.apache.inlong.audit.node.Application" | grep "inlong-audit"
| grep -v grep |awk '{print $2}' | xargs kill -9
+WAIT_TIME=30
+ps -ef | grep "org.apache.inlong.audit.node.Application" | grep "inlong-audit"
| grep -v grep |awk '{print $2}' | xargs kill
+
+echo "Stopping Audit Proxy application, please wait for $WAIT_TIME s. "
+
+sleep $WAIT_TIME
+
+ps -ef | grep "org.apache.inlong.audit.node.Application" | grep "inlong-audit"
| grep -v grep |awk '{print $2}' | xargs kill -9
\ No newline at end of file