abhishekrb19 commented on code in PR #17353:
URL: https://github.com/apache/druid/pull/17353#discussion_r1950111983
##########
indexing-service/src/main/java/org/apache/druid/indexing/scheduledbatch/ScheduledBatchSupervisorStatus.java:
##########
@@ -21,97 +21,137 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.druid.indexer.TaskStatus;
import org.joda.time.DateTime;
import org.joda.time.Duration;
import javax.annotation.Nullable;
-import java.util.Map;
+import java.util.List;
-public class ScheduledBatchSupervisorSnapshot
+/**
+ * Represents the status of a scheduled batch supervisor, including its state,
+ * scheduler details, task execution aggregate counts, and recent task
activity.
+ */
+public class ScheduledBatchSupervisorStatus
{
- public enum BatchSupervisorStatus
- {
- SCHEDULER_RUNNING,
- SCHEDULER_SHUTDOWN
- }
-
- @JsonProperty
private final String supervisorId;
- @JsonProperty
- private final BatchSupervisorStatus status;
+ private final ScheduledBatchSupervisor.State state;
@Nullable
- @JsonProperty
private final DateTime lastTaskSubmittedTime;
@Nullable
- @JsonProperty
private final DateTime nextTaskSubmissionTime;
@Nullable
- @JsonProperty
private final Duration timeUntilNextTaskSubmission;
- @JsonProperty
- private final Map<String, TaskStatus> activeTasks;
+ private final Integer totalSubmittedTasks;
- @JsonProperty
- private final Map<String, TaskStatus> completedTasks;
+ private final Integer totalSuccessfulTasks;
+
+ private final Integer totalFailedTasks;
+
+ private final List<BatchSupervisorTaskStatus> recentActiveTasks;
+
+ private final List<BatchSupervisorTaskStatus> recentSuccessfulTasks;
+
+ private final List<BatchSupervisorTaskStatus> recentFailedTasks;
@JsonCreator
- public ScheduledBatchSupervisorSnapshot(
+ public ScheduledBatchSupervisorStatus(
@JsonProperty("supervisorId") String supervisorId,
- @JsonProperty("status") BatchSupervisorStatus status,
+ @JsonProperty("status") ScheduledBatchSupervisor.State state,
@JsonProperty("lastTaskSubmittedTime") @Nullable DateTime
lastTaskSubmittedTime,
@JsonProperty("nextTaskSubmissionTime") @Nullable DateTime
nextTaskSubmissionTime,
@JsonProperty("timeUntilNextTaskSubmission") @Nullable Duration
timeUntilNextTaskSubmission,
- @JsonProperty("activeTasks") Map<String, TaskStatus> activeTasks,
- @JsonProperty("completedTasks") Map<String, TaskStatus> completedTasks
+ @JsonProperty("totalSubmittedTasks") Integer totalSubmittedTasks,
+ @JsonProperty("totalSuccessfulTasks") Integer totalSuccessfulTasks,
+ @JsonProperty("totalFailedTasks") Integer totalFailedTasks,
+ @JsonProperty("recentActiveTasks") List<BatchSupervisorTaskStatus>
recentActiveTasks,
+ @JsonProperty("recentSuccessfulTasks") List<BatchSupervisorTaskStatus>
recentSuccessfulTasks,
+ @JsonProperty("recentFailedTasks") List<BatchSupervisorTaskStatus>
recentFailedTasks
)
{
this.supervisorId = supervisorId;
- this.status = status;
+ this.state = state;
this.lastTaskSubmittedTime = lastTaskSubmittedTime;
this.nextTaskSubmissionTime = nextTaskSubmissionTime;
this.timeUntilNextTaskSubmission = timeUntilNextTaskSubmission;
- this.activeTasks = activeTasks;
- this.completedTasks = completedTasks;
+ this.totalSubmittedTasks = totalSubmittedTasks;
+ this.totalSuccessfulTasks = totalSuccessfulTasks;
+ this.totalFailedTasks = totalFailedTasks;
+ this.recentActiveTasks = recentActiveTasks;
+ this.recentSuccessfulTasks = recentSuccessfulTasks;
+ this.recentFailedTasks = recentFailedTasks;
}
+ @JsonProperty
public String getSupervisorId()
{
return supervisorId;
}
- public ScheduledBatchSupervisorSnapshot.BatchSupervisorStatus getStatus()
+ @JsonProperty
+ public ScheduledBatchSupervisor.State getState()
{
- return status;
+ return state;
}
+ @Nullable
+ @JsonProperty
public DateTime getLastTaskSubmittedTime()
{
return lastTaskSubmittedTime;
}
+ @Nullable
+ @JsonProperty
public DateTime getNextTaskSubmissionTime()
{
return nextTaskSubmissionTime;
}
+ @Nullable
+ @JsonProperty
public Duration getTimeUntilNextTaskSubmission()
Review Comment:
I've removed this for now
--
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]