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


##########
solr/core/src/java/org/apache/solr/cloud/api/collections/SplitShardCmd.java:
##########
@@ -862,14 +862,18 @@ public static void checkDiskSpace(
                 SolrRequest.METHOD.GET, "/admin/metrics", 
SolrRequest.SolrRequestType.ADMIN, params)
             .process(cloudManager.getSolrClient());
 
-    Number size = (Number) rsp.getResponse().findRecursive("metrics", 
indexSizeMetricName);
+    NamedList<Object> entries1 = rsp.getResponse();

Review Comment:
   again, no need to declare another variable



##########
solr/core/src/java/org/apache/solr/cli/HealthcheckTool.java:
##########
@@ -173,9 +173,12 @@ protected void runCloudTool(CloudSolrClient 
cloudSolrClient, CommandLine cli) th
                   solrClient.request(
                       new GenericSolrRequest(
                           SolrRequest.METHOD.GET, 
CommonParams.SYSTEM_INFO_PATH));
-              uptime = SolrCLI.uptime((Long) systemInfo.findRecursive("jvm", 
"jmx", "upTimeMS"));
-              String usedMemory = (String) systemInfo.findRecursive("jvm", 
"memory", "used");
-              String totalMemory = (String) systemInfo.findRecursive("jvm", 
"memory", "total");
+              Object value2 = systemInfo._get(List.of("jvm", "jmx", 
"upTimeMS"), null);
+              uptime = SolrCLI.uptime((Long) value2);
+              Object value1 = systemInfo._get(List.of("jvm", "memory", 
"used"), null);

Review Comment:
   use _getStr, same with below



##########
solr/core/src/java/org/apache/solr/cli/AssertTool.java:
##########
@@ -280,7 +281,8 @@ public int assertSolrNotRunning(String url, String 
credentials) throws Exception
         System.nanoTime() + TimeUnit.NANOSECONDS.convert(timeoutMs, 
TimeUnit.MILLISECONDS);
     try (SolrClient solrClient = CLIUtils.getSolrClient(url, credentials)) {
       NamedList<Object> response = solrClient.request(new 
HealthCheckRequest());
-      Integer statusCode = (Integer) response.findRecursive("responseHeader", 
"status");
+      Object value = response._get(List.of(new String[] {"responseHeader", 
"status"}), null);
+      Integer statusCode = (Integer) value;

Review Comment:
   Don't declare new variables merely to cast.



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