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 2019/03/02 07:10:55 UTC

[GitHub] wu-sheng commented on a change in pull request #2309: When creating elastic search index, the index that can delete histori…

wu-sheng commented on a change in pull request #2309: When creating elastic search index, the index that can delete histori…
URL: https://github.com/apache/incubator-skywalking/pull/2309#discussion_r261816453
 
 

 ##########
 File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/ttl/DataTTLKeeperTimer.java
 ##########
 @@ -63,6 +64,28 @@ public void start(ModuleManager moduleManager) {
         Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(
             new RunnableWithExceptionProtection(this::delete,
                 t -> logger.error("Remove data in background failure.", t)), 1, 5, TimeUnit.MINUTES);
+
+        Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(new RunnableWithExceptionProtection(this::deleteAndCreateOther, t -> logger.error("delete index in background failure.", t)), 1, 2, TimeUnit.HOURS);
+    }
+
+    private void deleteAndCreateOther() {
+        TimeBuckets timeBuckets = convertTimeBucket(new DateTime());
+        IModelGetter modelGetter = moduleManager.find(CoreModule.NAME).provider().getService(IModelGetter.class);
+        List<Model> models = modelGetter.getModels();
+        DownsamplingConfigService downsamplingConfigService = moduleManager.find(CoreModule.NAME).provider().getService(DownsamplingConfigService.class);
+        List<Model> allModels = new ArrayList<>();
+        models.forEach(model -> {
 
 Review comment:
   Create so many indexes daily? Look like crazy. I think only segment index has performance concern.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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