kfaraz commented on code in PR #18184:
URL: https://github.com/apache/druid/pull/18184#discussion_r2177874694


##########
extensions-core/lookups-cached-global/src/main/java/org/apache/druid/server/lookup/namespace/cache/OnHeapNamespaceExtractionCacheManager.java:
##########
@@ -42,6 +43,7 @@
 /**
  *
  */
+@ManageLifecycle

Review Comment:
   Do not use this annotation. Use `ManageLifecycle` scope in 
`NamespaceExtractionModule` instead.



##########
extensions-core/lookups-cached-global/src/main/java/org/apache/druid/server/lookup/namespace/cache/NamespaceExtractionCacheManager.java:
##########
@@ -41,14 +40,15 @@
  * cacheHandler.close();
  * }</pre>
  */
+
 public abstract class NamespaceExtractionCacheManager
 {
   private static final Logger log = new 
Logger(NamespaceExtractionCacheManager.class);
 
-  private final ScheduledThreadPoolExecutor scheduledExecutorService;
+  protected final ScheduledThreadPoolExecutor scheduledExecutorService;

Review Comment:
   We shouldn't need to make this protected.
   Instead add a `stop()` method to shutdown the executor service.
   The sub-classes can call the stop method from their own stop methods.



##########
extensions-core/lookups-cached-global/src/main/java/org/apache/druid/server/lookup/namespace/cache/NamespaceExtractionCacheManager.java:
##########
@@ -61,11 +61,16 @@ public NamespaceExtractionCacheManager(
             .setPriority(Thread.MIN_PRIORITY)
             .build()
     );
-    ExecutorServices.manageLifecycle(lifecycle, scheduledExecutorService);
-    scheduledExecutorService.scheduleAtFixedRate(
+    this.serviceEmitter = serviceEmitter;
+  }
+
+  @LifecycleStart
+  public void initExecutor()

Review Comment:
   ```suggestion
     public void start()
   ```



##########
extensions-core/lookups-cached-global/src/main/java/org/apache/druid/server/lookup/namespace/cache/NamespaceExtractionCacheManager.java:
##########
@@ -61,11 +61,16 @@ public NamespaceExtractionCacheManager(
             .setPriority(Thread.MIN_PRIORITY)
             .build()
     );
-    ExecutorServices.manageLifecycle(lifecycle, scheduledExecutorService);
-    scheduledExecutorService.scheduleAtFixedRate(
+    this.serviceEmitter = serviceEmitter;
+  }
+
+  @LifecycleStart
+  public void initExecutor()
+  {
+    this.scheduledExecutorService.scheduleAtFixedRate(
         () -> {
           try {
-            monitor(serviceEmitter);
+            monitor(this.serviceEmitter);

Review Comment:
   The `this` is redundant here.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to