mlbiscoc commented on code in PR #1704:
URL: https://github.com/apache/solr/pull/1704#discussion_r1238659078


##########
solr/core/src/java/org/apache/solr/handler/admin/api/CoreReplicationAPI.java:
##########
@@ -46,12 +50,24 @@ public CoreReplicationAPI(SolrCore solrCore, 
SolrQueryRequest req, SolrQueryResp
 
   @GET
   @Path("/indexversion")
-  @Produces({"application/json", "application/xml", BINARY_CONTENT_TYPE_V2})
+  @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, 
BINARY_CONTENT_TYPE_V2})
   @PermissionName(CORE_READ_PERM)
   public IndexVersionResponse fetchIndexVersion() throws IOException {
     return doFetchIndexVersion();
   }
 
+  @GET
+  @Path("/files/generation/{gen}")

Review Comment:
   Thanks for sending the spreadsheet. I didn't know this link existed.
   
   So I originally had generation as a query parameter but then changed it into 
the path-param on purpose. Here was my thought process:
   
   I usually thought of a path-param for things like ```ID``` (in this case the 
generation number) and then query-parameter as a filter. So the idea was that 
lets say for some hypothetical reason (not saying this is going to or should be 
added) we wanted to filter down by the ```filelist``` name on that index for 
that generation, it could then look like this:
   ```
   GET /cores/coreName/replication/files/generation/1?name=_0_Lucene90_0.tim
   ```
   
   If we think doing something like this will never happen, then I could move 
the generation into a query param otherwise I think this makes more sense.
   



##########
solr/core/src/java/org/apache/solr/handler/admin/api/ReplicationAPIBase.java:
##########
@@ -38,10 +68,140 @@ public ReplicationAPIBase(
   }
 
   protected CoreReplicationAPI.IndexVersionResponse doFetchIndexVersion() 
throws IOException {
+    ReplicationHandler replicationHandler =
+        (ReplicationHandler) 
solrCore.getRequestHandler(ReplicationHandler.PATH);
+    return replicationHandler.getIndexVersionResponse();
+  }
 
+  protected NamedList<Object> doFetchFiles(long generation) {
     ReplicationHandler replicationHandler =
         (ReplicationHandler) 
solrCore.getRequestHandler(ReplicationHandler.PATH);
+    return getFileList(generation, replicationHandler);
+  }
 
-    return replicationHandler.getIndexVersionResponse();
+  protected NamedList<Object> getFileList(long generation, ReplicationHandler 
replicationHandler) {
+    final IndexDeletionPolicyWrapper delPol = solrCore.getDeletionPolicy();
+    final NamedList<Object> filesResponse = new NamedList<>();
+
+    IndexCommit commit = null;
+    try {
+      if (generation == -1) {

Review Comment:
   This makes sense to me and like that idea. I could try changing it myself in 
this PR but if you think this requires more discussion or would like to do it 
yourself in another PR I'll leave as is.



-- 
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: issues-unsubscr...@solr.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to