You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "zachjsh (via GitHub)" <gi...@apache.org> on 2023/12/04 19:38:57 UTC

Re: [PR] Add api for Retrieving unused segments (druid)

zachjsh commented on code in PR #15415:
URL: https://github.com/apache/druid/pull/15415#discussion_r1414399541


##########
server/src/main/java/org/apache/druid/metadata/SegmentsMetadataManager.java:
##########
@@ -125,6 +125,25 @@ Optional<Iterable<DataSegment>> iterateAllUsedNonOvershadowedSegmentsForDatasour
       boolean requiresLatest
   );
 
+  /**
+   * Returns an iterable to go over all un-used segments of given a datasource over given interval.

Review Comment:
   fixed



##########
server/src/main/java/org/apache/druid/server/http/DataSourcesResource.java:
##########
@@ -410,7 +414,74 @@ public Response getServedSegmentsInInterval(
       }
       return Response.ok(segmentIds).build();
     }
-    return getServedSegmentsInInterval(dataSourceName, full != null, theInterval::contains);
+    return getServedSegmentsInInterval(dataSource, full != null, theInterval::contains);
+  }
+
+  @GET
+  @Path("/{dataSourceName}/unused/intervals")
+  @Produces(MediaType.APPLICATION_JSON)
+  @ResourceFilters(DatasourceResourceFilter.class)
+  public Response getIntervalsWithUnusedSegmentsOrAllUnusedSegmentsPerIntervals(
+      @PathParam("dataSourceName") String dataSourceName,

Review Comment:
   fixed



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org