This is an automated email from the ASF dual-hosted git repository.

marklau99 pushed a commit to branch IOTDB-5504
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 014abcaf2b76c98a2f56097af23df04639bd9a44
Author: Liu Xuxin <[email protected]>
AuthorDate: Thu Feb 9 19:59:58 2023 +0800

    fix illegal argument exception occurs when scheduling compaction
---
 .../main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java 
b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
index f5c7d38d26..a2ee2ce3d2 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
@@ -112,6 +112,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Comparator;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -2172,7 +2173,7 @@ public class DataRegion implements IDataRegionForQuery {
     try {
       List<Long> timePartitions = new 
ArrayList<>(tsFileManager.getTimePartitions());
       // sort the time partition from largest to smallest
-      timePartitions.sort((o1, o2) -> (int) (o2 - o1));
+      timePartitions.sort(Comparator.reverseOrder());
       for (long timePartition : timePartitions) {
         CompactionScheduler.scheduleCompaction(tsFileManager, timePartition);
       }

Reply via email to