Akshat-Jain commented on code in PR #16328:
URL: https://github.com/apache/druid/pull/16328#discussion_r1582047557


##########
server/src/main/java/org/apache/druid/query/lookup/LookupReferencesManager.java:
##########
@@ -373,10 +376,25 @@ private void takeSnapshot(Map<String, 
LookupExtractorFactoryContainer> lookupMap
     }
   }
 
-  private void loadAllLookupsAndInitStateRef()
+  /**
+   * Load a set of lookups based on the injected value in {@link 
DataSourceTaskIdHolder#getLookupLoadingSpec()}.
+   */
+  private void loadLookupsAndInitStateRef()
   {
-    List<LookupBean> lookupBeanList = getLookupsList();
-    if (lookupBeanList != null) {
+    LookupLoadingSpec lookupLoadingSpec = 
lookupListeningAnnouncerConfig.getLookupLoadingSpec();
+    List<LookupBean> lookupBeanList;
+    if (lookupLoadingSpec.getMode() == LookupLoadingSpec.Mode.NONE) {
+      lookupBeanList = Collections.emptyList();
+    } else {
+      lookupBeanList = getLookupsList();
+      if (lookupLoadingSpec.getMode() == LookupLoadingSpec.Mode.PARTIAL && 
lookupBeanList != null) {
+        lookupBeanList = lookupBeanList.stream()
+                                       .filter(lookupBean -> 
lookupLoadingSpec.getLookupsToLoad().contains(lookupBean.getName()))
+                                       .collect(Collectors.toList());
+      }
+    }
+

Review Comment:
   I have logged LookupLoadingSpec itself, that should provide us with enough 
info to debug things in this code flow.



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