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



##########
File path: 
server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
##########
@@ -1378,26 +1375,30 @@ public void delete(PartialPath deviceId, String 
measurementId, long startTime, l
     List<ModificationFile> updatedModFiles = new ArrayList<>();
 
     try {
-      Long lastUpdateTime = null;
-      for (Map<String, Long> latestTimeMap : latestTimeForEachDevice.values()) 
{
-        Long curTime = latestTimeMap.get(deviceId.getFullPath());
-        if (curTime != null && (lastUpdateTime == null || lastUpdateTime < 
curTime)) {
-          lastUpdateTime = curTime;
+      for (PartialPath p : IoTDB.metaManager.getAllTimeseriesPath(path)) {
+        PartialPath deviceId = p.getDevicePath();
+        String measurementId = p.getMeasurement();
+        Long lastUpdateTime = null;
+        for (Map<String, Long> latestTimeMap : 
latestTimeForEachDevice.values()) {
+          Long curTime = latestTimeMap.get(deviceId.getFullPath());
+          if (curTime != null && (lastUpdateTime == null || lastUpdateTime < 
curTime)) {
+            lastUpdateTime = curTime;
+          }
         }
-      }
-
-      // There is no tsfile data, the delete operation is invalid
-      if (lastUpdateTime == null) {
-        logger.debug("No device {} in SG {}, deletion invalid", deviceId, 
storageGroupName);
-        return;
+        // There is no tsfile data, the delete operation is invalid
+        if (lastUpdateTime == null) {
+          logger.debug("No device {} in SG {}, deletion invalid", deviceId, 
storageGroupName);
+          return;
+        }
+        // delete Last cache record if necessary
+        tryToDeleteLastCache(deviceId, measurementId, startTime, endTime);
       }
 
       // write log to impacted working TsFileProcessors
-      logDeletion(startTime, endTime, deviceId, measurementId);
-      // delete Last cache record if necessary
-      tryToDeleteLastCache(deviceId, measurementId, startTime, endTime);
-      Deletion deletion = new Deletion(deviceId.concatNode(measurementId),
-          MERGE_MOD_START_VERSION_NUM, startTime, endTime);
+      // TODO rewrite logDeletion

Review comment:
       It's resolved. Remove the TODO




----------------------------------------------------------------
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:
[email protected]


Reply via email to