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


##########
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:
   API updated with generation now as a query parameter



##########
solr/core/src/java/org/apache/solr/handler/admin/api/CoreReplicationAPI.java:
##########
@@ -88,4 +90,137 @@ public IndexVersionResponse(Long indexVersion, Long 
generation, String status) {
       this.status = status;
     }
   }
+
+  /** Response for {@link CoreReplicationAPI#fetchFileList(long)}. */
+  public static class FileListResponse extends SolrJerseyResponse {
+    @JsonProperty("filelist")
+    public List<FileMetaData> fileList;
+
+    @JsonProperty("confFiles")
+    public List<FileMetaData> confFiles;
+
+    @JsonProperty("status")
+    public String status;
+
+    @JsonProperty("message")
+    public String message;
+
+    @JsonProperty("exception")
+    public Exception exception;
+
+    public FileListResponse() {}
+
+    public void addToFileList(List<FileMetaData> fileMetaData) {
+      if (fileList == null) {
+        fileList = new ArrayList<>();
+      }
+      fileList.addAll(fileMetaData);
+    }
+
+    public void addToConfFiles(List<FileMetaData> confFilesMetaData) {
+      if (confFiles == null) {
+        confFiles = new ArrayList<>();
+      }
+      confFiles.addAll(confFilesMetaData);
+    }
+
+    public void setFileList(List<FileMetaData> fileList) {

Review Comment:
   I took another look and removed them. After some though, I don't think they 
do provide any value. These are supposed to be POJO objects and should be 
nothing but a response object without being overly complex.



-- 
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