gerlowskija commented on code in PR #2912:
URL: https://github.com/apache/solr/pull/2912#discussion_r1890512324


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

Review Comment:
   I can omit the field from the v2 response if you'd like, but this seems like 
a much larger concern than this PR.  It's only in the v2 response because it's 
in the v1 COLSTATUS response. (And it's only there because it's being persisted 
to ZK!)



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