shardObject.put("active", true);
} else {
shardObject.put("active", false);
shardObject.put("result_status", taskState.getStatus().getStatusCode());
}
IncrementalTask task = taskState.getTask();
if (task instanceof IncrementalTaskWithContext) {
IncrementalTaskContext context = ((IncrementalTaskWithContext) task).getContext();
totalCounters.addAll(context.getCounters());
workerCallCounts[i] = context.getWorkerCallCount();
shardObject.put("last_work_item", context.getLastWorkItemString());