mlbiscoc commented on code in PR #3955: URL: https://github.com/apache/solr/pull/3955#discussion_r2628909315
########## solr/solrj/src/java/org/apache/solr/client/solrj/response/SystemInfoResponse.java: ########## @@ -0,0 +1,126 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.solr.client.solrj.response; + +import java.lang.invoke.MethodHandles; +import java.util.Date; +import org.apache.solr.client.solrj.request.json.JacksonContentWriter; +import org.apache.solr.common.util.NamedList; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** This class holds the response from V1 "/admin/info/system" or V2 "/node/system" */ +public class SystemInfoResponse extends SolrResponseBase { + + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + + private static final long serialVersionUID = 1L; + + private org.apache.solr.client.api.model.SystemInfoResponse fullResponse; + + public SystemInfoResponse(NamedList<Object> namedList) { + setResponse(namedList); + init(); Review Comment: This almost looks like a redundant `init` call because `init()` is called inside of `setResponse` in the case of null. The base response class looks to initialize the response as null, so you can probably just do `setResponse` and drop the init()? Should this constructor even be allowed to have null passed? ########## solr/solrj/src/java/org/apache/solr/client/solrj/request/MetricsRequest.java: ########## @@ -0,0 +1,69 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.solr.client.solrj.request; + +import org.apache.solr.client.solrj.SolrRequest; +import org.apache.solr.client.solrj.SolrResponse; +import org.apache.solr.client.solrj.response.SolrResponseBase; +import org.apache.solr.common.params.CommonParams; +import org.apache.solr.common.params.ModifiableSolrParams; +import org.apache.solr.common.params.SolrParams; +import org.apache.solr.common.util.NamedList; + +/** Request to "/admin/metrics" */ +public class MetricsRequest extends SolrRequest<SolrResponse> { + + private static final long serialVersionUID = 1L; + + private final SolrParams params; + + /** Request to "/admin/metrics" by default, without params */ + public MetricsRequest() { + this(METHOD.GET, CommonParams.METRICS_PATH, SolrRequestType.ADMIN, new ModifiableSolrParams()); + } + + /** + * @param params the Solr parameters to use for this request. + */ + public MetricsRequest(SolrParams params) { + this(METHOD.GET, CommonParams.METRICS_PATH, SolrRequestType.ADMIN, params); + } + + /** + * @param method the HTTP method to use for this request. + * @param path the HTTP path to use for this request. Supports V1 "/admin/info/system" (default) + * or V2 "/node/system" + * @param requestType the type of this request + * @param params query parameter names and values for making this request. Review Comment: This java doc looks to still reference `/admin/info/system` but should be `/admin/metrics` -- 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]
