qiaojialin commented on a change in pull request #1732:
URL: https://github.com/apache/incubator-iotdb/pull/1732#discussion_r491784393



##########
File path: 
server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
##########
@@ -226,17 +229,18 @@ public void insertTablet(InsertTabletPlan 
insertTabletPlan, int start, int end,
    * <p>
    * Delete data in both working MemTable and flushing MemTables.
    */
-  public void deleteDataInMemory(Deletion deletion) {
+  public void deleteDataInMemory(Deletion deletion) throws MetadataException {
     flushQueryLock.writeLock().lock();
     if (logger.isDebugEnabled()) {
       logger
           .debug(FLUSH_QUERY_WRITE_LOCKED, storageGroupName, 
tsFileResource.getTsFile().getName());
     }
     try {
-      if (workMemTable != null) {
-        workMemTable
-            .delete(deletion.getDevice(), deletion.getMeasurement(), 
deletion.getStartTime(),
-                deletion.getEndTime());
+      for (PartialPath p : 
IoTDB.metaManager.getAllTimeseriesPath(deletion.getPath())) {

Review comment:
       put the for into the if

##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/PartialPath.java
##########
@@ -99,6 +105,41 @@ public PartialPath concatNode(String node) {
     return nodes;
   }
 
+  public int getNodeLength() {
+    return nodes.length;
+  }
+
+  public PartialPath alterPrefixPath(PartialPath prefixPath) {

Review comment:
       add javadoc

##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/PartialPath.java
##########
@@ -99,6 +105,41 @@ public PartialPath concatNode(String node) {
     return nodes;
   }
 
+  public int getNodeLength() {

Review comment:
       change the fullPath in concatPath()

##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/PartialPath.java
##########
@@ -99,6 +105,41 @@ public PartialPath concatNode(String node) {
     return nodes;
   }
 
+  public int getNodeLength() {
+    return nodes.length;
+  }
+
+  public PartialPath alterPrefixPath(PartialPath prefixPath) {
+    String[] newNodes = Arrays.copyOf(nodes, Math.max(nodes.length, 
prefixPath.getNodeLength()));
+    System.arraycopy(prefixPath.getNodes(), 0, newNodes, 0, 
prefixPath.getNodeLength());
+    return new PartialPath(newNodes);
+  }
+
+  public void setPrefixPath(PartialPath prefixPath) {
+    this.nodes = Arrays.copyOf(nodes, Math.max(nodes.length, 
prefixPath.getNodeLength()));
+    System.arraycopy(prefixPath.getNodes(), 0, nodes, 0, 
prefixPath.getNodeLength());
+    fullPath = String.join(TsFileConstant.PATH_SEPARATOR, nodes);
+  }
+
+  public boolean matchFullPath(String rPath) throws IllegalPathException {
+    return matchFullPath(new PartialPath(rPath));
+  }
+
+  public boolean matchFullPath(PartialPath rPath) {

Review comment:
       add javadoc and give an example for each case

##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/MTree.java
##########
@@ -503,7 +503,22 @@ private void findStorageGroup(
   }
 
   /**
-   * Get all storage group under give path
+   * Get the storage group that given path belonged to or under given path

Review comment:
       add an example

##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/MManager.java
##########
@@ -771,6 +771,15 @@ public PartialPath getStorageGroupPath(PartialPath path) 
throws StorageGroupNotS
     }
   }
 
+  public List<PartialPath> getRelatedStorageGroups(PartialPath path) throws 
MetadataException {

Review comment:
       add javadoc




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to