gerlowskija commented on code in PR #2912: URL: https://github.com/apache/solr/pull/2912#discussion_r1890516257
########## solr/api/src/java/org/apache/solr/client/api/model/CollectionStatusResponse.java: ########## @@ -0,0 +1,164 @@ +/* + * 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.api.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Response of the CollectionStatusApi.getCollectionStatus() API */ +public class CollectionStatusResponse extends SolrJerseyResponse { + + @JsonProperty public String name; + @JsonProperty public Integer znodeVersion; + @JsonProperty public Long creationTimeMillis; + @JsonProperty public CollectionMetadata properties; + @JsonProperty public Integer activeShards; + @JsonProperty public Integer inactiveShards; + @JsonProperty public List<String> schemaNonCompliant; + + @JsonProperty public Map<String, ShardMetadata> shards; + + // Always present in response + public static class CollectionMetadata { + @JsonProperty public String configName; + @JsonProperty public Integer nrtReplicas; + @JsonProperty public Integer pullReplicas; + @JsonProperty public Integer tlogReplicas; + @JsonProperty public Map<String, String> router; + @JsonProperty public Integer replicationFactor; + } + + // Always present in response + public static class ShardMetadata { + @JsonProperty public String state; // TODO Make this an enum? + @JsonProperty public String range; + @JsonProperty public ReplicaSummary replicas; + @JsonProperty public LeaderSummary leader; + } + + // ALways present in response + public static class ReplicaSummary { + @JsonProperty public Integer total; + @JsonProperty public Integer active; + @JsonProperty public Integer down; + @JsonProperty public Integer recovering; + + @JsonProperty("recovery_failed") + public Integer recoveryFailed; + } + + // Always present in response unless otherwise specified + public static class LeaderSummary { + @JsonProperty public String coreNode; + @JsonProperty public String core; + @JsonProperty public Boolean leader; + + @JsonProperty("node_name") + public String nodeName; + + @JsonProperty("base_url") + public String baseUrl; + + @JsonProperty public String state; // TODO Make this an enum? + @JsonProperty public String type; // TODO Make this an enum? + + @JsonProperty("force_set_state") + public Boolean forceSetState; + + // Present with coreInfo=true || sizeInfo=true unless otherwise specified + @JsonProperty public SegmentInfo segInfos; + } + + // Present with coreInfo=true || sizeInfo=true unless otherwise specified + public static class SegmentInfo { + // Present with coreInfo=true || sizeInfo=true unless otherwise specified + @JsonProperty public SegmentSummary info; + + // Present with rawSize=true + @JsonProperty public RawSize rawSize; + + // Present with fieldInfo=true....this seems pretty useless in isolation? Is it maybe a bad + // param name? + @JsonProperty public List<String> fieldInfoLegend; + } + + // Present with rawSize=true unless otherwise specified + public static class RawSize { + @JsonProperty public Map<String, String> fieldsBySize; + @JsonProperty public Map<String, String> typesBySize; + + // Present with rawSizeDetails=true + @JsonProperty public Object details; + + // Present with rawSizeSummary=true + @JsonProperty public Map<String, Object> summary; + } + + // Present with coreInfo=true || sizeInfo=true unless otherwise specified + public static class SegmentSummary { + @JsonProperty public String minSegmentLuceneVersion; + @JsonProperty public String commitLuceneVersion; + @JsonProperty public Integer numSegments; + @JsonProperty public String segmentsFileName; + @JsonProperty public Integer totalMaxDoc; + + @JsonProperty + public Map<String, String> + userData; // Typically keys are 'commitCommandVer' and 'commitTimeMSec' Review Comment: It's ugly for sure. Tidy is well-intentioned, but often a blunt instrument. It's probably not worth too much of our time trying to clean up after it, but I'm happy to fix these few bits you highlighted. -- 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