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


##########
server/src/main/java/org/apache/druid/query/lookup/LookupReferencesManager.java:
##########
@@ -373,11 +374,28 @@ private void takeSnapshot(Map<String, 
LookupExtractorFactoryContainer> lookupMap
     }
   }
 
-  private void loadAllLookupsAndInitStateRef()
+  /**
+   * Load a set of lookups.
+   * @param lookupsToLoad List of lookup names to load. Pass null to load all 
lookups.
+   */
+  private void loadLookupsAndInitStateRef(List<String> lookupsToLoad)
   {
     List<LookupBean> lookupBeanList = getLookupsList();
-    if (lookupBeanList != null) {
-      startLookups(lookupBeanList);
+
+    List<LookupBean> lookupBeansToLoad;
+    if (lookupsToLoad != null) {
+      lookupBeansToLoad = new ArrayList<>();
+      if (lookupBeanList != null) {
+        lookupBeansToLoad = lookupBeanList.stream()
+                                          .filter(lookupBean -> 
lookupsToLoad.contains(lookupBean.getName()))
+                                          .collect(Collectors.toList());
+      }
+    } else {
+      lookupBeansToLoad = lookupBeanList;
+    }
+
+    if (lookupBeansToLoad != null) {
+      startLookups(lookupBeansToLoad);

Review Comment:
   Makes sense, have made the change.



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