You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2023/02/10 02:05:41 UTC

[iotdb] branch rel/1.0 updated: [To rel/1.0] [IOTDB-5504] Fix illegal argument exception occurs when scheduling compaction

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

jackietien pushed a commit to branch rel/1.0
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/rel/1.0 by this push:
     new f0602a3932 [To rel/1.0] [IOTDB-5504] Fix illegal argument exception occurs when scheduling compaction
f0602a3932 is described below

commit f0602a3932eae563ae1364ac8c1b59cbb9ffc2f0
Author: Liu Xuxin <37...@users.noreply.github.com>
AuthorDate: Fri Feb 10 10:05:34 2023 +0800

    [To rel/1.0] [IOTDB-5504] 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);
       }