surekhasaharan commented on a change in pull request #8547: Add 
`sys.supervisors` table to system tables
URL: https://github.com/apache/incubator-druid/pull/8547#discussion_r329873831
 
 

 ##########
 File path: 
server/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorStatus.java
 ##########
 @@ -0,0 +1,241 @@
+/*
+ * 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.druid.indexing.overlord.supervisor;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
+import com.google.common.base.Preconditions;
+
+import java.util.Objects;
+
+/**
+ * This class contains the attributes of a supervisor task which are returned 
by the API's in
+ * org.apache.druid.indexing.overlord.supervisor.SupervisorResource
+ * and used by 
org.apache.druid.sql.calcite.schema.SystemSchema.SupervisorsTable
+ */
+@JsonDeserialize(builder = SupervisorStatus.Builder.class)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class SupervisorStatus
+{
+  private final String id;
+  private final String state;
+  private final String detailedState;
+  private final boolean healthy;
+  private final SupervisorSpec spec;
+  /**
+   * This is a JSON representation of {@code spec}
+   * The explicit serialization is present here so that users of  {@code 
SupervisorStatus} which cannot
 
 Review comment:
   yeah it seems to work in my local cluster, the exception with using 
`SupervisorSpec` instead of string was 
   ```
   java.lang.RuntimeException: 
com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance 
of org.apache.druid.indexing.kafka.supervisor.KafkaSupervisorSpec, problem: 
Guice configuration errors:
   1) No implementation for org.apache.druid.indexing.overlord.TaskStorage was 
bound.
     while locating org.apache.druid.indexing.overlord.TaskStorage
   ```
   
   the way it works is, i create `SupervisorStatus` with json string 
[here](https://github.com/apache/incubator-druid/blob/c5bf351331976c4b0144510fe1829314bcbc97aa/indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java#L170),
 so `SupervisorStatus#getSpecString` returns the json payload, and 
`SupervisorStatus#getSpec` would return null in this case. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to