You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2020/11/17 10:41:08 UTC

[iotdb] branch rel/0.11 updated (ab5d35b -> 8b38d61)

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

qiaojialin pushed a change to branch rel/0.11
in repository https://gitbox.apache.org/repos/asf/iotdb.git.


    from ab5d35b  Add Sonar and Coveralls Check using Github Action (#2052)
     new 6b8aad8  Remove unnecessary delete path check
     new e06cec6  fix filechannal force and interrupting-related exception(#2038)
     new 8b38d61  fix compaction file not exist but

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../engine/compaction/utils/CompactionUtils.java   |  3 +++
 .../org/apache/iotdb/db/metadata/MLogWriter.java   |  1 +
 .../apache/iotdb/db/qp/executor/PlanExecutor.java  |  4 ---
 .../iotdb/db/integration/IoTDBDeletionIT.java      | 29 ++++++++++++++++++++++
 .../apache/iotdb/db/utils/EnvironmentUtils.java    | 18 ++++++--------
 5 files changed, 41 insertions(+), 14 deletions(-)


[iotdb] 01/03: Remove unnecessary delete path check

Posted by qi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 6b8aad868b764152f00f456713570fb0d8e9441b
Author: wshao08 <ko...@163.com>
AuthorDate: Mon Nov 16 11:55:31 2020 +0800

    Remove unnecessary delete path check
    
    (cherry picked from commit 5b653a48dfc00703ccb8611c8791378a7a95b795)
---
 .../apache/iotdb/db/qp/executor/PlanExecutor.java  |  4 ---
 .../iotdb/db/integration/IoTDBDeletionIT.java      | 29 ++++++++++++++++++++++
 2 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java b/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
index e8fe6ad..66a6dcf 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
@@ -848,10 +848,6 @@ public class PlanExecutor implements IPlanExecutor {
   public void delete(PartialPath path, long startTime, long endTime, long planIndex)
       throws QueryProcessException {
     try {
-      if (!IoTDB.metaManager.isPathExist(path)) {
-        throw new QueryProcessException(
-            String.format("Time series %s does not exist.", path.getFullPath()));
-      }
       StorageEngine.getInstance().delete(path, startTime, endTime, planIndex);
     } catch (StorageEngineException e) {
       throw new QueryProcessException(e);
diff --git a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBDeletionIT.java b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBDeletionIT.java
index 3f9daf7..3da375a 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBDeletionIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBDeletionIT.java
@@ -203,6 +203,35 @@ public class IoTDBDeletionIT {
   }
 
   @Test
+  public void testPartialPathRangeDelete() throws SQLException {
+    prepareData();
+    try (Connection connection = DriverManager
+            .getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root",
+                    "root");
+         Statement statement = connection.createStatement()) {
+
+      statement.execute("DELETE FROM root.vehicle.d0.* WHERE time <= 300 and time > 150");
+      try (ResultSet set = statement.executeQuery("SELECT s0 FROM root.vehicle.d0")) {
+        int cnt = 0;
+        while (set.next()) {
+          cnt++;
+        }
+        assertEquals(250, cnt);
+      }
+
+      statement.execute("DELETE FROM root.vehicle.*.s0 WHERE time <= 100");
+      try (ResultSet set = statement.executeQuery("SELECT s0 FROM root.vehicle.d0")) {
+        int cnt = 0;
+        while (set.next()) {
+          cnt++;
+        }
+        assertEquals(150, cnt);
+      }
+    }
+    cleanData();
+  }
+
+  @Test
   public void testDelFlushingMemtable() throws SQLException {
     long size = IoTDBDescriptor.getInstance().getConfig().getMemtableSizeThreshold();
     // Adjust memstable threshold size to make it flush automatically


[iotdb] 03/03: fix compaction file not exist but

Posted by qi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8b38d61a7d76e2885392b73f84866ed56c08c820
Author: qiaojialin <64...@qq.com>
AuthorDate: Tue Nov 17 18:40:39 2020 +0800

    fix compaction file not exist but
---
 .../org/apache/iotdb/db/engine/compaction/utils/CompactionUtils.java   | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/server/src/main/java/org/apache/iotdb/db/engine/compaction/utils/CompactionUtils.java b/server/src/main/java/org/apache/iotdb/db/engine/compaction/utils/CompactionUtils.java
index a2ef1fe..d44234f 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/compaction/utils/CompactionUtils.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/compaction/utils/CompactionUtils.java
@@ -198,6 +198,9 @@ public class CompactionUtils {
       for (TsFileResource levelResource : tsFileResources) {
         TsFileSequenceReader reader = buildReaderFromTsFileResource(levelResource,
             tsFileSequenceReaderMap, storageGroup);
+        if (reader == null) {
+          continue;
+        }
         Map<String, List<ChunkMetadata>> chunkMetadataMap = reader
             .readChunkMetadataInDevice(device);
         for (Entry<String, List<ChunkMetadata>> entry : chunkMetadataMap.entrySet()) {


[iotdb] 02/03: fix filechannal force and interrupting-related exception(#2038)

Posted by qi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e06cec691c65f650b071ca540e7e7bb3a671feaa
Author: Zesong Sun <sz...@mails.tsinghua.edu.cn>
AuthorDate: Mon Nov 16 20:06:28 2020 +0800

    fix filechannal force and interrupting-related exception(#2038)
    
    (cherry picked from commit 07ab57d8b19112fba0a2b988dd9cf05baa1ed945)
---
 .../java/org/apache/iotdb/db/metadata/MLogWriter.java  |  1 +
 .../org/apache/iotdb/db/utils/EnvironmentUtils.java    | 18 ++++++++----------
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/MLogWriter.java b/server/src/main/java/org/apache/iotdb/db/metadata/MLogWriter.java
index 5f77527..538e6ea 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/MLogWriter.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/MLogWriter.java
@@ -175,6 +175,7 @@ public class MLogWriter {
   }
 
   public void clear() throws IOException {
+    channel.force(true);
     channel.close();
     fileOutputStream.close();
     Files.delete(logFile.toPath());
diff --git a/server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java b/server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
index 76782ab..c1ea53e 100644
--- a/server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
+++ b/server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
@@ -74,7 +74,8 @@ public class EnvironmentUtils {
 
   private static IoTDB daemon;
 
-  public static boolean examinePorts = Boolean.valueOf(System.getProperty("test.port.closed", "false"));
+  public static boolean examinePorts = Boolean
+      .parseBoolean(System.getProperty("test.port.closed", "false"));
 
   public static void cleanEnv() throws IOException, StorageEngineException {
     logger.warn("EnvironmentUtil cleanEnv...");
@@ -147,6 +148,7 @@ public class EnvironmentUtils {
         transport.close();
         return false;
       } catch (TTransportException e) {
+        //do nothing
       }
     }
     //try sync service
@@ -158,6 +160,7 @@ public class EnvironmentUtils {
         transport.close();
         return false;
       } catch (TTransportException e) {
+        //do nothing
       }
     }
     //try jmx connection
@@ -172,20 +175,14 @@ public class EnvironmentUtils {
       //do nothing
     }
     //try MetricService
-    Socket socket = new Socket();
-    try {
+    try (Socket socket = new Socket()) {
       socket.connect(new InetSocketAddress("127.0.0.1", 8181), 100);
       logger.error("stop MetricService failed. 8181 can be connected now.");
       return false;
     } catch (Exception e) {
       //do nothing
-    } finally {
-      try {
-        socket.close();
-      } catch (IOException e) {
-        //do nothing
-      }
     }
+    //do nothing
     return true;
   }
 
@@ -256,7 +253,7 @@ public class EnvironmentUtils {
   }
 
   public static void shutdownDaemon() throws Exception {
-    if(daemon != null) {
+    if (daemon != null) {
       daemon.shutdown();
     }
   }
@@ -278,6 +275,7 @@ public class EnvironmentUtils {
 
   public static void restartDaemon() throws Exception {
     shutdownDaemon();
+    stopDaemon();
     reactiveDaemon();
   }