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


##########
server/src/main/java/org/apache/druid/query/lookup/LookupReferencesManager.java:
##########
@@ -282,6 +282,13 @@ public void stop()
   public void add(String lookupName, LookupExtractorFactoryContainer 
lookupExtractorFactoryContainer)
   {
     Preconditions.checkState(lifecycleLock.awaitStarted(1, 
TimeUnit.MILLISECONDS));
+    LookupLoadingSpec lookupLoadingSpec = 
lookupListeningAnnouncerConfig.getLookupLoadingSpec();
+    if (lookupLoadingSpec.getMode() == LookupLoadingSpec.Mode.NONE ||
+        (lookupLoadingSpec.getMode() == LookupLoadingSpec.Mode.ONLY_REQUIRED
+         && !lookupLoadingSpec.getLookupsToLoad().contains(lookupName))) {
+      LOG.warn("Skipping notice to add lookup [%s] : current lookup loading 
mode does not allow it.", lookupName);

Review Comment:
   Nit:
   ```suggestion
         LOG.warn("Skipping notice to add lookup[%s] since current lookup 
loading mode does not allow it.", lookupName);
   ```



##########
server/src/test/java/org/apache/druid/query/lookup/LookupReferencesManagerTest.java:
##########
@@ -849,6 +849,26 @@ public void testCoordinatorLoadSubsetOfLookups() throws 
Exception
     Assert.assertFalse(lookupReferencesManager.get("testLookup3").isPresent());
   }
 
+  @Test
+  public void testAddWithLoadingSpec() throws Exception
+  {
+    LookupLoadingSpec loadingSpec = 
LookupLoadingSpec.loadOnly(ImmutableSet.of("testLookup1"));
+    getLookupMapForSelectiveLoadingOfLookups(loadingSpec);
+
+    LookupExtractorFactoryContainer container2 = new 
LookupExtractorFactoryContainer(
+        "0",
+        new MapLookupExtractorFactory(ImmutableMap.of("key2", "value2"), true

Review Comment:
   Use `Map.of` and `Set.of` for brevity.



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