refactor(monitor): 表数据清理交给运维同事统一处理

This commit is contained in:
v-zhangjc9
2024-06-04 11:01:49 +08:00
parent f4c7f9954b
commit 4c528bca61
2 changed files with 0 additions and 64 deletions

View File

@@ -1,33 +0,0 @@
package com.lanyuanxiaoyao.service.monitor.clean;
import com.lanyuanxiaoyao.service.forest.service.InfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import static com.lanyuanxiaoyao.service.common.Constants.MINUTE;
/**
* 清理compaction metrics表
*
* @author lanyuanxiaoyao
* @date 2024-05-23
*/
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
@Service
public class CompactionMetricsCleaner extends Cleaner {
private static final Logger logger = LoggerFactory.getLogger(CompactionMetricsCleaner.class);
private final InfoService infoService;
public CompactionMetricsCleaner(InfoService infoService) {
this.infoService = infoService;
}
@Scheduled(cron = "0 0 6 * * ?")
@Override
void clean() {
logger.info("Clean compaction metrics: {}", infoService.cleanCompactionMetrics());
}
}

View File

@@ -1,31 +0,0 @@
package com.lanyuanxiaoyao.service.monitor.clean;
import com.lanyuanxiaoyao.service.forest.service.InfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
/**
* 清理table version表
*
* @author lanyuanxiaoyao
* @date 2024-05-23
*/
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
@Service
public class TableVersionCleaner extends Cleaner {
private static final Logger logger = LoggerFactory.getLogger(TableVersionCleaner.class);
private final InfoService infoService;
public TableVersionCleaner(InfoService infoService) {
this.infoService = infoService;
}
@Scheduled(cron = "0 0 7 * * ?")
@Override
void clean() {
logger.info("Clean table version: {}", infoService.cleanTableVersion());
}
}