// Path: src/main/java/com/behase/relumin/config/SchedulerConfig.java
// @Data
// public class SchedulerConfig {
//     public static final String DEFAULT_REFRESH_CLUSTERS_INTERVAL_MILLIS = "120000";
//     public static final String DEFAULT_COLLECT_STATICS_INFO_INTERVAL_MILLIS = "120000";
//     public static final String DEFAULT_COLLECT_STATICS_INFO_MAX_COUNT = "1500";
//     public static final String DEFAULT_COLLECT_SLOW_LOG_MAX_COUNT = "1500";
// 
//     private String refreshClustersIntervalMillis;
// 
//     private String collectStaticsInfoIntervalMillis;
//     private String collectStaticsInfoMaxCount;
//     private String collectSlowLogMaxCount;
// }
// 
// Path: src/main/java/com/behase/relumin/service/ClusterService.java
// public interface ClusterService {
//     Set<String> getClusters();
// 
//     Cluster getCluster(String clusterName) throws IOException;
// 
//     Cluster getClusterByHostAndPort(String hostAndPort) throws IOException;
// 
//     boolean existsClusterName(String clusterName);
// 
//     void setCluster(String clusterName, String node) throws IOException;
// 
//     void changeClusterName(String clusterName, String newClusterName) throws IOException;
// 
//     Notice getClusterNotice(String clusterName) throws IOException;
// 
//     void setClusterNotice(String clusterName, Notice notice) throws IOException;
// 
//     void deleteCluster(String clusterName);
// 
//     void refreshClusters();
// 
//     ClusterNode getActiveClusterNode(String clusterName) throws IOException;
// 
//     ClusterNode getActiveClusterNodeWithExcludeNodeId(String clusterName, String nodeId) throws IOException;
// 
//     ClusterNode getActiveClusterNodeWithExcludeHostAndPort(String clusterName, String hostAndPort) throws IOException;
// 
//     Map<String, Map<String, List<List<Object>>>> getClusterStaticsInfoHistory(String clusterName, List<String> nodes,
//                                                                               List<String> fields, long start, long end);
// 
//     PagerData<SlowLog> getClusterSlowLogHistory(String clusterName, long offset, long limit);
// }


import com.behase.relumin.config.SchedulerConfig;
import com.behase.relumin.service.ClusterService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
package com.behase.relumin.scheduler;


@Slf4j
@Component
@Profile(value = "!test")
public class ClusterScheduler {
    @Autowired
    ClusterService clusterService;

    @Scheduled(fixedDelayString = "${scheduler.refreshClustersIntervalMillis:"
            + SchedulerConfig.DEFAULT_REFRESH_CLUSTERS_INTERVAL_MILLIS + "}"
    )
// Path: src/main/java/com/behase/relumin/config/SchedulerConfig.java
// @Data
// public class SchedulerConfig {
//     public static final String DEFAULT_REFRESH_CLUSTERS_INTERVAL_MILLIS = "120000";
//     public static final String DEFAULT_COLLECT_STATICS_INFO_INTERVAL_MILLIS = "120000";
//     public static final String DEFAULT_COLLECT_STATICS_INFO_MAX_COUNT = "1500";
//     public static final String DEFAULT_COLLECT_SLOW_LOG_MAX_COUNT = "1500";
// 
//     private String refreshClustersIntervalMillis;
// 
//     private String collectStaticsInfoIntervalMillis;
//     private String collectStaticsInfoMaxCount;
//     private String collectSlowLogMaxCount;
// }
// 
// Path: src/main/java/com/behase/relumin/service/ClusterService.java
// public interface ClusterService {
//     Set<String> getClusters();
// 
//     Cluster getCluster(String clusterName) throws IOException;
// 
//     Cluster getClusterByHostAndPort(String hostAndPort) throws IOException;
// 
//     boolean existsClusterName(String clusterName);
// 
//     void setCluster(String clusterName, String node) throws IOException;
// 
//     void changeClusterName(String clusterName, String newClusterName) throws IOException;
// 
//     Notice getClusterNotice(String clusterName) throws IOException;
// 
//     void setClusterNotice(String clusterName, Notice notice) throws IOException;
// 
//     void deleteCluster(String clusterName);
// 
//     void refreshClusters();
// 
//     ClusterNode getActiveClusterNode(String clusterName) throws IOException;
// 
//     ClusterNode getActiveClusterNodeWithExcludeNodeId(String clusterName, String nodeId) throws IOException;
// 
//     ClusterNode getActiveClusterNodeWithExcludeHostAndPort(String clusterName, String hostAndPort) throws IOException;
// 
//     Map<String, Map<String, List<List<Object>>>> getClusterStaticsInfoHistory(String clusterName, List<String> nodes,
//                                                                               List<String> fields, long start, long end);
// 
//     PagerData<SlowLog> getClusterSlowLogHistory(String clusterName, long offset, long limit);
// }


// Path: src/main/java/com/behase/relumin/scheduler/ClusterScheduler.java
import com.behase.relumin.config.SchedulerConfig;
import com.behase.relumin.service.ClusterService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

package com.behase.relumin.scheduler;


@Slf4j
@Component
@Profile(value = "!test")
public class ClusterScheduler {
    @Autowired
    ClusterService clusterService;

    @Scheduled(fixedDelayString = "${scheduler.refreshClustersIntervalMillis:"
            + SchedulerConfig.DEFAULT_REFRESH_CLUSTERS_INTERVAL_MILLIS + "}"
    )
    public void refreshClusters() {