kfaraz commented on code in PR #13967:
URL: https://github.com/apache/druid/pull/13967#discussion_r1170093595
##########
server/src/main/java/org/apache/druid/server/http/MetadataResource.java:
##########
@@ -165,6 +172,81 @@ public Response getAllUsedSegments(
return builder.entity(authorizedSegments).build();
}
+ @GET
+ @Path("/changedSegments")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Response getChangedSegments(
+ @Context final HttpServletRequest req,
+ @QueryParam("datasources") final @Nullable Set<String> dataSources,
+ @QueryParam("counter") long counter,
+ @QueryParam("hash") long hash
+ )
+ {
+ Set<String> requiredDataSources = (null == dataSources) ? new HashSet<>()
: dataSources;
+
+ log.debug("Changed segments requested. counter [%d], hash [%d],
dataSources [%s]", counter, hash, requiredDataSources);
+
+ DataSourcesSnapshot dataSourcesSnapshot =
segmentsMetadataManager.getSnapshotOfDataSourcesWithAllUsedSegments();
+
+ ChangeRequestsSnapshot<DataSegmentChange> changeRequestsSnapshot =
dataSourcesSnapshot.getChangesSince(new ChangeRequestHistory.Counter(counter,
hash));
Review Comment:
Please check all the changed classes to ensure that code adheres to proper
Druid formatting. e.g. no line should exceed the hard limit of 120 chars. It
makes code difficult to read.
--
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]