You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2018/10/24 12:16:03 UTC

[GitHub] wu-sheng closed pull request #1803: fix the issue #1529

wu-sheng closed pull request #1803: fix the issue #1529
URL: https://github.com/apache/incubator-skywalking/pull/1803
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/StorageModuleShardingjdbcConfig.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/StorageModuleShardingjdbcConfig.java
index e850678cf..e8643d376 100644
--- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/StorageModuleShardingjdbcConfig.java
+++ b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/StorageModuleShardingjdbcConfig.java
@@ -23,5 +23,51 @@
 /**
  * @author linjiaqi
  */
-class StorageModuleShardingjdbcConfig extends ShardingjdbcClientConfig {
+public class StorageModuleShardingjdbcConfig extends ShardingjdbcClientConfig {
+    
+    private int traceDataTTL = 90;
+    private int minuteMetricDataTTL = 90;
+    private int hourMetricDataTTL = 36;
+    private int dayMetricDataTTL = 45;
+    private int monthMetricDataTTL = 18;
+    
+    public int getTraceDataTTL() {
+        return traceDataTTL;
+    }
+    
+    void setTraceDataTTL(int traceDataTTL) {
+        this.traceDataTTL = traceDataTTL == 0 ? 90 : traceDataTTL;
+    }
+    
+    public int getMinuteMetricDataTTL() {
+        return minuteMetricDataTTL;
+    }
+    
+    void setMinuteMetricDataTTL(int minuteMetricDataTTL) {
+        this.minuteMetricDataTTL = minuteMetricDataTTL == 0 ? 90 : minuteMetricDataTTL;
+    }
+    
+    public int getHourMetricDataTTL() {
+        return hourMetricDataTTL;
+    }
+    
+    void setHourMetricDataTTL(int hourMetricDataTTL) {
+        this.hourMetricDataTTL = hourMetricDataTTL == 0 ? 36 : hourMetricDataTTL;
+    }
+    
+    public int getDayMetricDataTTL() {
+        return dayMetricDataTTL;
+    }
+    
+    void setDayMetricDataTTL(int dayMetricDataTTL) {
+        this.dayMetricDataTTL = dayMetricDataTTL == 0 ? 45 : dayMetricDataTTL;
+    }
+    
+    public int getMonthMetricDataTTL() {
+        return monthMetricDataTTL;
+    }
+    
+    void setMonthMetricDataTTL(int monthMetricDataTTL) {
+        this.monthMetricDataTTL = monthMetricDataTTL == 0 ? 18 : monthMetricDataTTL;
+    }
 }
diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/StorageModuleShardingjdbcProvider.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/StorageModuleShardingjdbcProvider.java
index 627640e29..fa1ab5cbe 100644
--- a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/StorageModuleShardingjdbcProvider.java
+++ b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/StorageModuleShardingjdbcProvider.java
@@ -33,29 +33,12 @@
 import org.apache.skywalking.apm.collector.storage.StorageException;
 import org.apache.skywalking.apm.collector.storage.StorageModule;
 import org.apache.skywalking.apm.collector.storage.base.dao.IBatchDAO;
-import org.apache.skywalking.apm.collector.storage.dao.IGlobalTracePersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.IInstanceHeartBeatPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.ISegmentDurationPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.ISegmentPersistenceDAO;
+import org.apache.skywalking.apm.collector.storage.dao.*;
 import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentDayPersistenceDAO;
 import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentHourPersistenceDAO;
 import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMinutePersistenceDAO;
 import org.apache.skywalking.apm.collector.storage.dao.acp.IApplicationComponentMonthPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListDayPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListHourPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListMinutePersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmListMonthPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationAlarmPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationReferenceAlarmListPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IApplicationReferenceAlarmPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceAlarmListPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceAlarmPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceReferenceAlarmListPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IInstanceReferenceAlarmPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceAlarmListPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceAlarmPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceReferenceAlarmListPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.dao.alarm.IServiceReferenceAlarmPersistenceDAO;
+import org.apache.skywalking.apm.collector.storage.dao.alarm.*;
 import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationDayMetricPersistenceDAO;
 import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationHourMetricPersistenceDAO;
 import org.apache.skywalking.apm.collector.storage.dao.amp.IApplicationMinuteMetricPersistenceDAO;
@@ -119,29 +102,12 @@
 import org.apache.skywalking.apm.collector.storage.dao.ui.*;
 import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.dao.BatchShardingjdbcDAO;
 import org.apache.skywalking.apm.collector.storage.shardingjdbc.base.define.ShardingjdbcStorageInstaller;
-import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.GlobalTraceShardingjdbcPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.InstanceHeartBeatShardingjdbcPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.SegmentDurationShardingjdbcPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.SegmentShardingjdbcPersistenceDAO;
+import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.*;
 import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.acp.ApplicationComponentDayShardingjdbcPersistenceDAO;
 import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.acp.ApplicationComponentHourShardingjdbcPersistenceDAO;
 import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.acp.ApplicationComponentMinuteShardingjdbcPersistenceDAO;
 import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.acp.ApplicationComponentMonthShardingjdbcPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ApplicationAlarmListShardingjdbcDayPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ApplicationAlarmListShardingjdbcHourPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ApplicationAlarmListShardingjdbcMinutePersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ApplicationAlarmListShardingjdbcMonthPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ApplicationAlarmShardingjdbcPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ApplicationReferenceAlarmListShardingjdbcPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ApplicationReferenceAlarmShardingjdbcPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.InstanceAlarmListShardingjdbcPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.InstanceAlarmShardingjdbcPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.InstanceReferenceAlarmListShardingjdbcPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.InstanceReferenceAlarmShardingjdbcPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ServiceAlarmListShardingjdbcPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ServiceAlarmShardingjdbcPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ServiceReferenceAlarmListShardingjdbcPersistenceDAO;
-import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.ServiceReferenceAlarmShardingjdbcPersistenceDAO;
+import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.alarm.*;
 import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.amp.ApplicationDayMetricShardingjdbcPersistenceDAO;
 import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.amp.ApplicationHourMetricShardingjdbcPersistenceDAO;
 import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.amp.ApplicationMinuteMetricShardingjdbcPersistenceDAO;
@@ -204,6 +170,8 @@
 import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.srmp.ServiceReferenceMonthMetricShardingjdbcPersistenceDAO;
 import org.apache.skywalking.apm.collector.storage.shardingjdbc.dao.ui.*;
 import org.apache.skywalking.apm.collector.storage.shardingjdbc.strategy.ShardingjdbcStrategy;
+import org.apache.skywalking.apm.collector.storage.shardingjdbc.ttl.TTLConfigService;
+import org.apache.skywalking.apm.collector.storage.ttl.ITTLConfigService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -245,6 +213,7 @@ public void prepare() throws ServiceNotProvidedException {
         ShardingRuleConfiguration shardingRuleConfig = createShardingRule(shardingjdbcClientConfigs.size());
         shardingjdbcClient = new ShardingjdbcClient(shardingjdbcClientConfigs, shardingRuleConfig);
         
+        this.registerServiceImplementation(ITTLConfigService.class, new TTLConfigService(config));
         this.registerServiceImplementation(IBatchDAO.class, new BatchShardingjdbcDAO(shardingjdbcClient));
         registerCacheDAO();
         registerRegisterDAO();
@@ -333,17 +302,6 @@ private void registerPersistenceDAO() throws ServiceNotProvidedException {
         this.registerServiceImplementation(IMemoryPoolDayMetricPersistenceDAO.class, new MemoryPoolDayMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
         this.registerServiceImplementation(IMemoryPoolMonthMetricPersistenceDAO.class, new MemoryPoolMonthMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
         
-        this.registerServiceImplementation(IGlobalTracePersistenceDAO.class, new GlobalTraceShardingjdbcPersistenceDAO(shardingjdbcClient));
-        
-        this.registerServiceImplementation(IResponseTimeDistributionMinutePersistenceDAO.class, new ResponseTimeDistributionMinuteShardingjdbcPersistenceDAO(shardingjdbcClient));
-        this.registerServiceImplementation(IResponseTimeDistributionHourPersistenceDAO.class, new ResponseTimeDistributionHourShardingjdbcPersistenceDAO(shardingjdbcClient));
-        this.registerServiceImplementation(IResponseTimeDistributionDayPersistenceDAO.class, new ResponseTimeDistributionDayShardingjdbcPersistenceDAO(shardingjdbcClient));
-        this.registerServiceImplementation(IResponseTimeDistributionMonthPersistenceDAO.class, new ResponseTimeDistributionMonthShardingjdbcPersistenceDAO(shardingjdbcClient));
-        
-        this.registerServiceImplementation(ISegmentDurationPersistenceDAO.class, new SegmentDurationShardingjdbcPersistenceDAO(shardingjdbcClient));
-        this.registerServiceImplementation(ISegmentPersistenceDAO.class, new SegmentShardingjdbcPersistenceDAO(shardingjdbcClient));
-        this.registerServiceImplementation(IInstanceHeartBeatPersistenceDAO.class, new InstanceHeartBeatShardingjdbcPersistenceDAO(shardingjdbcClient));
-        
         this.registerServiceImplementation(IApplicationComponentMinutePersistenceDAO.class, new ApplicationComponentMinuteShardingjdbcPersistenceDAO(shardingjdbcClient));
         this.registerServiceImplementation(IApplicationComponentHourPersistenceDAO.class, new ApplicationComponentHourShardingjdbcPersistenceDAO(shardingjdbcClient));
         this.registerServiceImplementation(IApplicationComponentDayPersistenceDAO.class, new ApplicationComponentDayShardingjdbcPersistenceDAO(shardingjdbcClient));
@@ -359,6 +317,13 @@ private void registerPersistenceDAO() throws ServiceNotProvidedException {
         this.registerServiceImplementation(IInstanceMappingDayPersistenceDAO.class, new InstanceMappingDayShardingjdbcPersistenceDAO(shardingjdbcClient));
         this.registerServiceImplementation(IInstanceMappingMonthPersistenceDAO.class, new InstanceMappingMonthShardingjdbcPersistenceDAO(shardingjdbcClient));
         
+        this.registerServiceImplementation(IGlobalTracePersistenceDAO.class, new GlobalTraceShardingjdbcPersistenceDAO(shardingjdbcClient));
+        
+        this.registerServiceImplementation(IResponseTimeDistributionMinutePersistenceDAO.class, new ResponseTimeDistributionMinuteShardingjdbcPersistenceDAO(shardingjdbcClient));
+        this.registerServiceImplementation(IResponseTimeDistributionHourPersistenceDAO.class, new ResponseTimeDistributionHourShardingjdbcPersistenceDAO(shardingjdbcClient));
+        this.registerServiceImplementation(IResponseTimeDistributionDayPersistenceDAO.class, new ResponseTimeDistributionDayShardingjdbcPersistenceDAO(shardingjdbcClient));
+        this.registerServiceImplementation(IResponseTimeDistributionMonthPersistenceDAO.class, new ResponseTimeDistributionMonthShardingjdbcPersistenceDAO(shardingjdbcClient));
+        
         this.registerServiceImplementation(IApplicationMinuteMetricPersistenceDAO.class, new ApplicationMinuteMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
         this.registerServiceImplementation(IApplicationHourMetricPersistenceDAO.class, new ApplicationHourMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
         this.registerServiceImplementation(IApplicationDayMetricPersistenceDAO.class, new ApplicationDayMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
@@ -369,15 +334,8 @@ private void registerPersistenceDAO() throws ServiceNotProvidedException {
         this.registerServiceImplementation(IApplicationReferenceDayMetricPersistenceDAO.class, new ApplicationReferenceDayMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
         this.registerServiceImplementation(IApplicationReferenceMonthMetricPersistenceDAO.class, new ApplicationReferenceMonthMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
         
-        this.registerServiceImplementation(IInstanceMinuteMetricPersistenceDAO.class, new InstanceMinuteMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
-        this.registerServiceImplementation(IInstanceHourMetricPersistenceDAO.class, new InstanceHourMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
-        this.registerServiceImplementation(IInstanceDayMetricPersistenceDAO.class, new InstanceDayMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
-        this.registerServiceImplementation(IInstanceMonthMetricPersistenceDAO.class, new InstanceMonthMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
-        
-        this.registerServiceImplementation(IInstanceReferenceMinuteMetricPersistenceDAO.class, new InstanceReferenceMinuteMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
-        this.registerServiceImplementation(IInstanceReferenceHourMetricPersistenceDAO.class, new InstanceReferenceHourMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
-        this.registerServiceImplementation(IInstanceReferenceDayMetricPersistenceDAO.class, new InstanceReferenceDayMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
-        this.registerServiceImplementation(IInstanceReferenceMonthMetricPersistenceDAO.class, new InstanceReferenceMonthMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
+        this.registerServiceImplementation(ISegmentDurationPersistenceDAO.class, new SegmentDurationShardingjdbcPersistenceDAO(shardingjdbcClient));
+        this.registerServiceImplementation(ISegmentPersistenceDAO.class, new SegmentShardingjdbcPersistenceDAO(shardingjdbcClient));
         
         this.registerServiceImplementation(IServiceMinuteMetricPersistenceDAO.class, new ServiceMinuteMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
         this.registerServiceImplementation(IServiceHourMetricPersistenceDAO.class, new ServiceHourMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
@@ -388,6 +346,19 @@ private void registerPersistenceDAO() throws ServiceNotProvidedException {
         this.registerServiceImplementation(IServiceReferenceHourMetricPersistenceDAO.class, new ServiceReferenceHourMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
         this.registerServiceImplementation(IServiceReferenceDayMetricPersistenceDAO.class, new ServiceReferenceDayMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
         this.registerServiceImplementation(IServiceReferenceMonthMetricPersistenceDAO.class, new ServiceReferenceMonthMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
+        
+        this.registerServiceImplementation(IInstanceMinuteMetricPersistenceDAO.class, new InstanceMinuteMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
+        this.registerServiceImplementation(IInstanceHourMetricPersistenceDAO.class, new InstanceHourMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
+        this.registerServiceImplementation(IInstanceDayMetricPersistenceDAO.class, new InstanceDayMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
+        this.registerServiceImplementation(IInstanceMonthMetricPersistenceDAO.class, new InstanceMonthMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
+        
+        this.registerServiceImplementation(IInstanceReferenceMinuteMetricPersistenceDAO.class, new InstanceReferenceMinuteMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
+        this.registerServiceImplementation(IInstanceReferenceHourMetricPersistenceDAO.class, new InstanceReferenceHourMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
+        this.registerServiceImplementation(IInstanceReferenceDayMetricPersistenceDAO.class, new InstanceReferenceDayMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
+        this.registerServiceImplementation(IInstanceReferenceMonthMetricPersistenceDAO.class, new InstanceReferenceMonthMetricShardingjdbcPersistenceDAO(shardingjdbcClient));
+        
+        this.registerServiceImplementation(IInstanceHeartBeatPersistenceDAO.class, new InstanceHeartBeatShardingjdbcPersistenceDAO(shardingjdbcClient));
+        this.registerServiceImplementation(IServiceNameHeartBeatPersistenceDAO.class, new ServiceNameHeartBeatShardingjdbcPersistenceDAO(shardingjdbcClient));
     }
     
     private void registerUiDAO() throws ServiceNotProvidedException {
diff --git a/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/ttl/TTLConfigService.java b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/ttl/TTLConfigService.java
new file mode 100644
index 000000000..5f20fde0c
--- /dev/null
+++ b/apm-collector/apm-collector-storage/collector-storage-shardingjdbc-provider/src/main/java/org/apache/skywalking/apm/collector/storage/shardingjdbc/ttl/TTLConfigService.java
@@ -0,0 +1,54 @@
+/*
+ * 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.skywalking.apm.collector.storage.shardingjdbc.ttl;
+
+import org.apache.skywalking.apm.collector.storage.shardingjdbc.StorageModuleShardingjdbcConfig;
+import org.apache.skywalking.apm.collector.storage.ttl.ITTLConfigService;
+
+/**
+ * @author linjiaqi
+ */
+public class TTLConfigService implements ITTLConfigService {
+
+    private StorageModuleShardingjdbcConfig config;
+
+    public TTLConfigService(StorageModuleShardingjdbcConfig config) {
+        this.config = config;
+    }
+
+    @Override public int traceDataTTL() {
+        return config.getTraceDataTTL();
+    }
+
+    @Override public int minuteMetricDataTTL() {
+        return config.getMinuteMetricDataTTL();
+    }
+
+    @Override public int hourMetricDataTTL() {
+        return config.getHourMetricDataTTL();
+    }
+
+    @Override public int dayMetricDataTTL() {
+        return config.getDayMetricDataTTL();
+    }
+
+    @Override public int monthMetricDataTTL() {
+        return config.getMonthMetricDataTTL();
+    }
+}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services