|
42 | 42 |
|
43 | 43 | import static org.apache.inlong.audit.service.config.ConfigConstants.DEFAULT_DATA_QUEUE_SIZE; |
44 | 44 | import static org.apache.inlong.audit.service.config.ConfigConstants.DEFAULT_ENABLE_STAT_AUDIT_DAY; |
| 45 | +import static org.apache.inlong.audit.service.config.ConfigConstants.DEFAULT_ENABLE_STAT_AUDIT_HOUR; |
| 46 | +import static org.apache.inlong.audit.service.config.ConfigConstants.DEFAULT_ENABLE_STAT_AUDIT_MINUTE_10; |
| 47 | +import static org.apache.inlong.audit.service.config.ConfigConstants.DEFAULT_ENABLE_STAT_AUDIT_MINUTE_30; |
45 | 48 | import static org.apache.inlong.audit.service.config.ConfigConstants.DEFAULT_SELECTOR_SERVICE_ID; |
46 | 49 | import static org.apache.inlong.audit.service.config.ConfigConstants.DEFAULT_SUMMARY_DAILY_STAT_BACK_TIMES; |
47 | 50 | import static org.apache.inlong.audit.service.config.ConfigConstants.DEFAULT_SUMMARY_REALTIME_STAT_BACK_TIMES; |
48 | 51 | import static org.apache.inlong.audit.service.config.ConfigConstants.KEY_DATA_QUEUE_SIZE; |
49 | 52 | import static org.apache.inlong.audit.service.config.ConfigConstants.KEY_ENABLE_STAT_AUDIT_DAY; |
| 53 | +import static org.apache.inlong.audit.service.config.ConfigConstants.KEY_ENABLE_STAT_AUDIT_HOUR; |
| 54 | +import static org.apache.inlong.audit.service.config.ConfigConstants.KEY_ENABLE_STAT_AUDIT_MINUTE_10; |
| 55 | +import static org.apache.inlong.audit.service.config.ConfigConstants.KEY_ENABLE_STAT_AUDIT_MINUTE_30; |
50 | 56 | import static org.apache.inlong.audit.service.config.ConfigConstants.KEY_SELECTOR_SERVICE_ID; |
51 | 57 | import static org.apache.inlong.audit.service.config.ConfigConstants.KEY_SUMMARY_DAILY_STAT_BACK_TIMES; |
52 | 58 | import static org.apache.inlong.audit.service.config.ConfigConstants.KEY_SUMMARY_REALTIME_STAT_BACK_TIMES; |
@@ -86,9 +92,20 @@ public void start() { |
86 | 92 | int statBackTimes = configuration.get(KEY_SUMMARY_REALTIME_STAT_BACK_TIMES, |
87 | 93 | DEFAULT_SUMMARY_REALTIME_STAT_BACK_TIMES); |
88 | 94 |
|
89 | | - startDataFlow(AuditCycle.MINUTE_10, statBackTimes, TenMinutesCache.getInstance().getCache()); |
90 | | - startDataFlow(AuditCycle.MINUTE_30, statBackTimes, HalfHourCache.getInstance().getCache()); |
91 | | - startDataFlow(AuditCycle.HOUR, statBackTimes, HourCache.getInstance().getCache()); |
| 95 | + if (configuration.get(KEY_ENABLE_STAT_AUDIT_MINUTE_10, DEFAULT_ENABLE_STAT_AUDIT_MINUTE_10)) { |
| 96 | + startDataFlow(AuditCycle.MINUTE_10, statBackTimes, TenMinutesCache.getInstance().getCache()); |
| 97 | + LOGGER.info("Start data flow for minute 10"); |
| 98 | + } |
| 99 | + |
| 100 | + if (configuration.get(KEY_ENABLE_STAT_AUDIT_MINUTE_30, DEFAULT_ENABLE_STAT_AUDIT_MINUTE_30)) { |
| 101 | + startDataFlow(AuditCycle.MINUTE_30, statBackTimes, HalfHourCache.getInstance().getCache()); |
| 102 | + LOGGER.info("Start data flow for minute 30"); |
| 103 | + } |
| 104 | + |
| 105 | + if (configuration.get(KEY_ENABLE_STAT_AUDIT_HOUR, DEFAULT_ENABLE_STAT_AUDIT_HOUR)) { |
| 106 | + startDataFlow(AuditCycle.HOUR, statBackTimes, HourCache.getInstance().getCache()); |
| 107 | + LOGGER.info("Start data flow for hour"); |
| 108 | + } |
92 | 109 |
|
93 | 110 | if (configuration.get(KEY_ENABLE_STAT_AUDIT_DAY, DEFAULT_ENABLE_STAT_AUDIT_DAY)) { |
94 | 111 | statBackTimes = configuration.get(KEY_SUMMARY_DAILY_STAT_BACK_TIMES, DEFAULT_SUMMARY_DAILY_STAT_BACK_TIMES); |
|
0 commit comments