private static double calculateQuotaOccupy(
      List<OptimizingTaskMeta> processTasks,
      List<TaskRuntime.TaskQuota> quotas,
      long startTime,
      long endTime) {
    double finishedOccupy = 0;
    if (quotas != null) {
      finishedOccupy = quotas.stream().mapToDouble(q -> q.getQuotaTime(startTime)).sum();
    }
    double runningOccupy = 0;
    if (processTasks != null) {
      runningOccupy =
          processTasks.stream()
              .mapToDouble(
                  t ->
                      TaskRuntime.taskRunningQuotaTime(
                          startTime, endTime, t.getStartTime(), t.getCostTime()))
              .sum();
    }
    return finishedOccupy + runningOccupy;
  }
Build current table optimize info.

@return TableOptimizeInfo
amoro-ams/src/main/java/org/apache/amoro/server/dashboard/utils/OptimizingUtil.java