gharris1727 commented on code in PR #16477:
URL: https://github.com/apache/kafka/pull/16477#discussion_r1664476993


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/rest/entities/WorkerStatus.java:
##########
@@ -0,0 +1,99 @@
+/*
+ * 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.kafka.connect.runtime.rest.entities;
+
+import org.apache.kafka.connect.util.Stage;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.Objects;
+
+public class WorkerStatus {
+
+    private final String status;
+    private final String message;
+
+    @JsonCreator
+    private WorkerStatus(
+            @JsonProperty("status") String status,
+            @JsonProperty("message") String message
+    ) {
+        this.status = status;
+        this.message = message;
+    }
+
+    public static WorkerStatus healthy() {
+        return new WorkerStatus(
+                "healthy",
+                "Worker has completed startup and is ready to handle requests."
+        );
+    }
+
+    public static WorkerStatus starting(Stage stage) {

Review Comment:
   Ah yeah this is very reasonable. For some reason I thought there were a lot 
of call-sites that would need an extra null guard, but that wasn't the case. 
This is great.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to