zhongqishang commented on code in PR #3292:
URL: https://github.com/apache/amoro/pull/3292#discussion_r1811910801


##########
.idea/icon.svg:
##########


Review Comment:
   We should not need to delete this file.



##########
.idea/vcs.xml:
##########


Review Comment:
   We should not need to delete this file.



##########
amoro-ams/src/main/java/org/apache/amoro/server/table/TableRuntime.java:
##########
@@ -611,11 +611,14 @@ public String toString() {
   public long getQuotaTime() {
     long calculatingEndTime = System.currentTimeMillis();
     long calculatingStartTime = calculatingEndTime - 
AmoroServiceConstants.QUOTA_LOOK_BACK_TIME;
-    taskQuotas.removeIf(task -> task.checkExpired(calculatingStartTime));
-    long finishedTaskQuotaTime =
-        taskQuotas.stream()
-            .mapToLong(taskQuota -> 
taskQuota.getQuotaTime(calculatingStartTime))
-            .sum();
+    long finishedTaskQuotaTime;
+    synchronized (taskQuotas) {

Review Comment:
   Can we use a concurrency-safe type instead? like `CopyOnWriteArrayList`?



-- 
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]

Reply via email to