weizhengte commented on code in PR #8860:
URL: https://github.com/apache/incubator-doris/pull/8860#discussion_r845695640


##########
fe/fe-core/src/main/java/org/apache/doris/statistics/StatisticsTask.java:
##########
@@ -33,23 +37,88 @@
  * @granularityDesc: StatsGranularity=partition
  */
 public class StatisticsTask implements Callable<StatisticsTaskResult> {
-    protected long id = Catalog.getCurrentCatalog().getNextId();;
+    protected static final Logger LOG = 
LogManager.getLogger(StatisticsTask.class);
+
+    public enum TaskState {
+        CREATED,
+        RUNNING,
+        FINISHED,
+        FAILED
+    }
+
+    protected long id = Catalog.getCurrentCatalog().getNextId();
+
     protected long jobId;
     protected StatsGranularityDesc granularityDesc;
     protected StatsCategoryDesc categoryDesc;
     protected List<StatsType> statsTypeList;
+    protected TaskState taskState = TaskState.CREATED;
+
+    protected final long createTime = System.currentTimeMillis();
+    protected long scheduleTime;
+    protected long finishTime;
 
-    public StatisticsTask(long jobId, StatsGranularityDesc granularityDesc,
-                          StatsCategoryDesc categoryDesc, List<StatsType> 
statsTypeList) {
+    public StatisticsTask(long jobId,
+                          StatsGranularityDesc granularityDesc,
+                          StatsCategoryDesc categoryDesc,
+                          List<StatsType> statsTypeList) {
         this.jobId = jobId;
         this.granularityDesc = granularityDesc;
         this.categoryDesc = categoryDesc;
         this.statsTypeList = statsTypeList;
     }
 
+    public long getId() {
+        return this.id;
+    }
+
+    public long getJobId() {
+        return this.jobId;
+    }
+
+    public StatsGranularityDesc getGranularityDesc() {
+        return this.granularityDesc;
+    }
+
+    public StatsCategoryDesc getCategoryDesc() {
+        return this.categoryDesc;
+    }
+
+    public List<StatsType> getStatsTypeList() {
+        return this.statsTypeList;
+    }
+
+    public TaskState getTaskState() {
+        return this.taskState;
+    }
+
+    public void setTaskState(TaskState taskState) {
+        this.taskState = taskState;
+    }
+
+    public long getCreateTime() {
+        return this.createTime;
+    }
+
+    public long getScheduleTime() {
+        return this.scheduleTime;
+    }
+
+    public void setScheduleTime(long scheduleTime) {
+        this.scheduleTime = scheduleTime;
+    }
+
+    public long getFinishTime() {
+        return this.finishTime;
+    }
+
+    public void setFinishTime(long finishTime) {
+        this.finishTime = finishTime;
+    }
+
     @Override
     public StatisticsTaskResult call() throws Exception {

Review Comment:
   Thanks for the suggestion, is this for a good follow-up extension? It means 
to abstract StatisticsTask into an abstract class, and then replace this class 
with similar OlapStatisticsTask and include public properties. 
   
   If so I think it can be done later, as it is less clear now whether other 
types of table statistics need to be analyzed.



-- 
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...@doris.apache.org

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


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

Reply via email to