kfaraz commented on code in PR #18192:
URL: https://github.com/apache/druid/pull/18192#discussion_r2181424726
##########
server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClient.java:
##########
@@ -101,4 +103,13 @@ public interface CoordinatorClient
* API: {@code POST /druid/coordinator/v1/config}
*/
ListenableFuture<Void>
updateCoordinatorDynamicConfig(CoordinatorDynamicConfig dynamicConfig);
+
+ /**
+ * Gets the lookup configuration for a tier.
+ * <p>
+ * API: {@code GET /druid/coordinator/v1/lookups/config/<tier>}
+ *
+ * @param tier The name of the tier for which the lookup configuration is to
be fetched.
+ */
+ ListenableFuture<Map<String, LookupExtractorFactoryContainer>>
fetchLookupsForTier(String tier);
Review Comment:
Please rename method to signify that this is a synchronous method unlike the
others in this interface.
Since it is synchronous, we need not return a future.
```suggestion
Map<String, LookupExtractorFactoryContainer>
fetchLookupsForTierSync(String tier);
```
##########
server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClient.java:
##########
@@ -101,4 +103,13 @@ public interface CoordinatorClient
* API: {@code POST /druid/coordinator/v1/config}
*/
ListenableFuture<Void>
updateCoordinatorDynamicConfig(CoordinatorDynamicConfig dynamicConfig);
+
+ /**
+ * Gets the lookup configuration for a tier.
Review Comment:
```suggestion
* Gets the lookup configuration for a tier synchronously.
```
##########
server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:
##########
@@ -250,4 +255,38 @@ public ListenableFuture<Void>
updateCoordinatorDynamicConfig(CoordinatorDynamicC
IgnoreHttpResponseHandler.INSTANCE
);
}
+
+ @Override
+ public ListenableFuture<Map<String, LookupExtractorFactoryContainer>>
fetchLookupsForTier(String tier)
+ {
+ final String path = StringUtils.format(
+ "/druid/coordinator/v1/lookups/config/%s?detailed=true",
+ StringUtils.urlEncode(tier)
+ );
+
+ try {
+ BytesFullResponseHolder responseHolder = client.request(
+ new RequestBuilder(HttpMethod.GET, path),
+ new BytesFullResponseHandler()
+ );
+ return Futures.immediateFuture(extractLookupFactory(responseHolder));
+ }
+
Review Comment:
Please remove this extra line.
--
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]