swaminathanmanish commented on code in PR #15044:
URL: https://github.com/apache/pinot/pull/15044#discussion_r1959080783


##########
pinot-spi/src/main/java/org/apache/pinot/spi/tasks/MinionTaskBaseObserverStats.java:
##########
@@ -0,0 +1,168 @@
+/**
+ * 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.pinot.spi.tasks;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import java.util.Deque;
+import java.util.LinkedList;
+import java.util.Objects;
+import org.apache.pinot.spi.utils.JsonUtils;
+
+
+public class MinionTaskBaseObserverStats {
+  protected String _taskId;
+  protected String _currentState;
+  protected long _startTimestamp;
+  protected Deque<StatusEntry> _progressLogs = new LinkedList<>();
+
+  public MinionTaskBaseObserverStats() {
+  }
+
+  public MinionTaskBaseObserverStats(MinionTaskBaseObserverStats from) {
+    _taskId = from.getTaskId();
+    _currentState = from.getCurrentState();
+    _startTimestamp = from.getStartTimestamp();
+    _progressLogs = new LinkedList<>(from.getProgressLogs());
+  }
+
+  public String getTaskId() {
+    return _taskId;
+  }
+
+  public MinionTaskBaseObserverStats setTaskId(String taskId) {
+    _taskId = taskId;
+    return this;
+  }
+
+  public long getStartTimestamp() {
+    return _startTimestamp;
+  }
+
+  public MinionTaskBaseObserverStats setStartTimestamp(long startTimestamp) {
+    _startTimestamp = startTimestamp;
+    return this;
+  }
+
+  public String getCurrentState() {
+    return _currentState;
+  }
+
+  public MinionTaskBaseObserverStats setCurrentState(String currentState) {
+    _currentState = currentState;
+    return this;
+  }
+
+  public Deque<StatusEntry> getProgressLogs() {
+    return _progressLogs;
+  }
+
+  public MinionTaskBaseObserverStats setProgressLogs(Deque<StatusEntry> 
progressLogs) {
+    _progressLogs = progressLogs;
+    return this;
+  }
+
+  public static MinionTaskBaseObserverStats fromJsonString(String statsJson)

Review Comment:
   Shouldn't derived class be able to override this ?
   Please add a test for a dummy derived class, so to show how this can be 
extended and used. 
   



-- 
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: commits-unsubscr...@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to