You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/11/01 22:32:28 UTC

[GitHub] [solr] epugh commented on a diff in pull request #1053: SOLR-16392: Refactor and update v2 DELETEREPLICAPROP API

epugh commented on code in PR #1053:
URL: https://github.com/apache/solr/pull/1053#discussion_r1010962959


##########
solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java:
##########
@@ -1298,19 +1298,25 @@ public Map<String, Object> execute(
           V2ApiUtils.squashIntoSolrResponseWithoutHeader(rsp, addReplicaPropResponse);
           return null;
         }),
-    // XXX should this command support followAliases?
     DELETEREPLICAPROP_OP(
         DELETEREPLICAPROP,
         (req, rsp, h) -> {
-          Map<String, Object> map =
-              copy(
-                  req.getParams().required(),
-                  null,
-                  COLLECTION_PROP,
-                  PROPERTY_PROP,
-                  SHARD_ID_PROP,
-                  REPLICA_PROP);
-          return copy(req.getParams(), map, PROPERTY_PROP);
+          final RequiredSolrParams requiredParams = req.getParams().required();
+          final String propNameToDelete = requiredParams.get(PROPERTY_PROP);
+          final String trimmedPropNameToDelete =
+              propNameToDelete.startsWith(PROPERTY_PREFIX)
+                  ? propNameToDelete.substring(PROPERTY_PREFIX.length())
+                  : propNameToDelete;
+          final DeleteReplicaPropertyAPI deleteReplicaPropertyAPI =

Review Comment:
   I don't think I'm the person to introduce new Java constructs to the Solr code base ;-)  I think if the community is up for it, great...   I might advocate that we do a big sweep through so that all the places `var` makes sense, we put that in, so it's not "a bit one way here, a bit the other way there"  And maybe we even have a way of checking that!



-- 
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-unsubscribe@solr.apache.org

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


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