You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by zy...@apache.org on 2022/12/20 01:10:28 UTC

[iotdb] branch master updated: [IOTDB-5239] UT related to delete timeseries (#8522)

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

zyk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new df6c60916d [IOTDB-5239] UT related to delete timeseries (#8522)
df6c60916d is described below

commit df6c60916dcb36a4de4d39fb4375b4990a9a9de7
Author: Chen YZ <43...@users.noreply.github.com>
AuthorDate: Tue Dec 20 09:10:18 2022 +0800

    [IOTDB-5239] UT related to delete timeseries (#8522)
---
 .../org/apache/iotdb/db/metadata/schemaregion/ISchemaRegion.java | 9 +++++++++
 .../iotdb/db/metadata/schemaRegion/SchemaRegionBasicTest.java    | 9 +++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/ISchemaRegion.java b/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/ISchemaRegion.java
index 3328fd0b44..be5c425cc7 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/ISchemaRegion.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/ISchemaRegion.java
@@ -116,6 +116,7 @@ public interface ISchemaRegion {
    * @param isPrefixMatch if true, the path pattern is used to match prefix path
    * @return deletion failed Timeseries
    */
+  @Deprecated
   Pair<Integer, Set<String>> deleteTimeseries(PartialPath pathPattern, boolean isPrefixMatch)
       throws MetadataException;
 
@@ -124,6 +125,8 @@ public interface ISchemaRegion {
    *
    * @param patternTree
    * @throws MetadataException
+   * @return preDeletedNum. If there are intersections of patterns in the patternTree, there may be
+   *     more than are actually pre-deleted.
    */
   long constructSchemaBlackList(PathPatternTree patternTree) throws MetadataException;
 
@@ -135,6 +138,12 @@ public interface ISchemaRegion {
    */
   void rollbackSchemaBlackList(PathPatternTree patternTree) throws MetadataException;
 
+  /**
+   * Fetch schema black list (timeseries that has been pre deleted).
+   *
+   * @param patternTree
+   * @throws MetadataException
+   */
   Set<PartialPath> fetchSchemaBlackList(PathPatternTree patternTree) throws MetadataException;
 
   /**
diff --git a/server/src/test/java/org/apache/iotdb/db/metadata/schemaRegion/SchemaRegionBasicTest.java b/server/src/test/java/org/apache/iotdb/db/metadata/schemaRegion/SchemaRegionBasicTest.java
index 9a9de452d9..4300c0a68c 100644
--- a/server/src/test/java/org/apache/iotdb/db/metadata/schemaRegion/SchemaRegionBasicTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/metadata/schemaRegion/SchemaRegionBasicTest.java
@@ -201,8 +201,13 @@ public class SchemaRegionBasicTest extends AbstractSchemaRegionTest {
     Assert.assertTrue(res3.get(2) instanceof PathAlreadyExistException);
   }
 
+  /**
+   * Test {@link ISchemaRegion#constructSchemaBlackList}, {@link
+   * ISchemaRegion#rollbackSchemaBlackList}, {@link ISchemaRegion#fetchSchemaBlackList} and{@link
+   * ISchemaRegion#deleteTimeseriesInBlackList}
+   */
   @Test
-  public void testConstructSchemaBlackList() throws Exception {
+  public void testDeleteTimeseries() throws Exception {
     ISchemaRegion schemaRegion = getSchemaRegion("root.sg", 0);
     schemaRegion.createTimeseries(
         new CreateTimeSeriesPlanImpl(
@@ -253,7 +258,7 @@ public class SchemaRegionBasicTest extends AbstractSchemaRegionTest {
     patternTree.appendPathPattern(new PartialPath("root.sg.wf01.*.status"));
     patternTree.appendPathPattern(new PartialPath("root.sg.wf02.wt01.temperature"));
     patternTree.constructTree();
-    Assert.assertTrue(schemaRegion.constructSchemaBlackList(patternTree) >= 3);
+    Assert.assertTrue(schemaRegion.constructSchemaBlackList(patternTree) >= 4);
     Assert.assertEquals(
         new HashSet<>(
             Arrays.asList(