abhishekrb19 commented on code in PR #18195:
URL: https://github.com/apache/druid/pull/18195#discussion_r2183974815
##########
server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClient.java:
##########
@@ -112,4 +116,43 @@ public interface CoordinatorClient
* @param tier The name of the tier for which the lookup configuration is to
be fetched.
*/
Map<String, LookupExtractorFactoryContainer> fetchLookupsForTierSync(String
tier);
+
+ /**
+ * Returns an iterator over the metadata segments in the cluster.
+ * <p>
+ * API: {@code GET
/druid/coordinator/v1/metadata/segments?includeOvershadowedStatus&includeRealtimeSegments}
+ *
+ * @param watchedDataSources Optional datasources to filter the segments by.
If null or empty, all segments are returned.
+ */
+ ListenableFuture<CloseableIterator<SegmentStatusInCluster>>
getMetadataSegments(
+ @Nullable Set<String> watchedDataSources
+ );
+
+ /**
+ * Returns the current snapshot of the rules.
+ * <p>
+ * API: {@code GET /druid/coordinator/v1/rules}
+ */
+ ListenableFuture<Map<String, List<Rule>>> getRules();
+
+ /**
+ * Returns the current coordinator leader's URI.
+ * <p>
+ * API: {@code GET /druid/coordinator/v1/leader}
+ */
+ ListenableFuture<URI> findCurrentLeader();
+
+ /**
+ * Returns the serialized user map for the given prefix stored in
coordinator.
+ * <p>
+ * API: {@code GET
/druid-ext/basic-security/authorization/db/<prefix>/cachedSerializedUserMap}
+ */
+ byte[] getCachedSerializedUserMapSync(String prefix);
+
+ /**
+ * Returns the serialized group mapping and role map for the given prefix
stored in coordinator.
+ * <p>
+ * API: {@code GET
/druid-ext/basic-security/authorization/db/<prefix>/cachedSerializedGroupMappingMap}
+ */
+ byte[] getCachedSerializedGroupMappingMapSync(String prefix);
Review Comment:
On the second point, it seems weird to have these APIs return `byte[]` -
it's error prone for callers as they have to understand the decoding semantics.
> I am opting to send to byte[] to the call point because sending
UserAndRoleMap was causing a circular dependency (the class is defined in
druid-basic-security extension). Do I change move the UserAndRoleMap and
relevant classes to druid-server module instead?
IMO it's fine to move the necessary classes from the security extension to
the `server` module for reuse and have the APIs return the corresponding
concrete POJO classes. It can be somewhere in or close to
`org.apache.druid.server.security`
--
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]