dsmiley commented on code in PR #2741:
URL: https://github.com/apache/solr/pull/2741#discussion_r1797418778


##########
solr/core/src/java/org/apache/solr/filestore/DistribFileStore.java:
##########
@@ -348,12 +371,12 @@ private void distribute(FileInfo info) {
       for (String node : nodes) {
         String baseUrl =
             
coreContainer.getZkController().getZkStateReader().getBaseUrlV2ForNodeName(node);
-        String url = baseUrl + "/node/files" + info.path + "?getFrom=";
+        String getFrom = "";

Review Comment:
   it'd be clearer to not initialize this here.  At the two lower lines, don't 
use append string operator, just set it equal to.



##########
solr/core/src/java/org/apache/solr/filestore/DistribFileStore.java:
##########
@@ -484,14 +512,21 @@ public List<FileDetails> list(String path, 
Predicate<String> predicate) {
   public void delete(String path) {
     deleteLocal(path);
     List<String> nodes = 
FileStoreUtils.fetchAndShuffleRemoteLiveNodes(coreContainer);
-    HttpClient client = 
coreContainer.getUpdateShardHandler().getDefaultHttpClient();
+
+    final var solrParams = new ModifiableSolrParams();
+    solrParams.add("localDelete", "true");
+    final var solrRequest = new GenericSolrRequest(DELETE, "/cluster/files" + 
path, solrParams);
+
     for (String node : nodes) {
       String baseUrl =
           
coreContainer.getZkController().getZkStateReader().getBaseUrlV2ForNodeName(node);
-      String url = baseUrl + "/cluster/files" + path + "?localDelete=true";
-      HttpDelete del = new HttpDelete(url);
-      // invoke delete command on all nodes asynchronously
-      coreContainer.runAsync(() -> Utils.executeHttpMethod(client, url, null, 
del));
+      try (var solrClient =

Review Comment:
   why create a new client?



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

Reply via email to