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


##########
server/src/main/java/org/apache/druid/query/lookup/LookupReferencesManager.java:
##########
@@ -476,38 +469,20 @@ private List<LookupBean> 
getLookupListFromCoordinator(String tier)
 
   @Nullable
   private Map<String, LookupExtractorFactoryContainer> 
tryGetLookupListFromCoordinator(String tier)
-      throws IOException, InterruptedException
   {
-    final StringFullResponseHolder response = fetchLookupsForTier(tier);
-    if (response.getStatus().equals(HttpResponseStatus.NOT_FOUND)) {
-      LOG.warn("No lookups found for tier [%s], response [%s]", tier, 
response);
-      return null;
-    } else if (!response.getStatus().equals(HttpResponseStatus.OK)) {
-      throw new IOE(
-          "Error while fetching lookup code from Coordinator with status[%s] 
and content[%s]",
-          response.getStatus(),
-          response.getContent()
-      );
+    try {
+      return FutureUtils.getUnchecked(
+          coordinatorClient.fetchLookupsForTier(tier), true);
     }
-
-    // Older version of getSpecificTier returns a list of lookup names.
-    // Lookup loading is performed via snapshot if older version is present.
-    // This check is only for backward compatibility and should be removed in 
a future release
-    if (response.getContent().startsWith("[")) {
-      LOG.info(
-          "Failed to retrieve lookup information from coordinator, " +
-          "because coordinator appears to be running on older Druid version. " 
+
-          "Attempting to load lookups using snapshot instead"
-      );
-      return null;
-    } else {
-      Map<String, Object> lookupNameToGenericConfig =
-          jsonMapper.readValue(response.getContent(), 
LOOKUPS_ALL_GENERIC_REFERENCE);
-      return LookupUtils.tryConvertObjectMapToLookupConfigMap(
-          lookupNameToGenericConfig,
-          jsonMapper
+    catch (Exception e) {
+      HttpResponseException httpEx = (HttpResponseException) e.getCause();
+      LOG.warn(

Review Comment:
   No, we need to continue doing what the old code was doing.
   
   1. NOT_FOUND: return null
   2, OK: return value
   3. else: throw exception
   
   2 and 3 will be done automatically by the combination of 
`CoordinatorClient.get()` and `FutureUtils.getUnchecked`.
   We just need to handle 1 separately.



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