HTHou commented on code in PR #16687:
URL: https://github.com/apache/iotdb/pull/16687#discussion_r2508622118
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java:
##########
@@ -2900,12 +2900,102 @@ private void deleteDataInUnsealedFiles(
private void deleteDataInSealedFiles(Collection<TsFileResource>
sealedTsFiles, ModEntry deletion)
throws IOException {
Set<ModificationFile> involvedModificationFiles = new HashSet<>();
+ List<TsFileResource> deletedByMods = new ArrayList<>();
+ List<TsFileResource> deletedByFiles = new ArrayList<>();
for (TsFileResource sealedTsFile : sealedTsFiles) {
if (canSkipDelete(sealedTsFile, deletion)) {
continue;
}
- involvedModificationFiles.add(sealedTsFile.getModFileForWrite());
+ ITimeIndex timeIndex = sealedTsFile.getTimeIndex();
+
+ if ((timeIndex instanceof ArrayDeviceTimeIndex)
+ && (deletion.getType() == ModEntry.ModType.TABLE_DELETION)) {
+ ArrayDeviceTimeIndex deviceTimeIndex = (ArrayDeviceTimeIndex)
timeIndex;
+ Set<IDeviceID> devicesInFile = deviceTimeIndex.getDevices();
+ boolean onlyOneTable = false;
+
+ if (deletion instanceof TableDeletionEntry) {
+ TableDeletionEntry tableDeletionEntry = (TableDeletionEntry)
deletion;
+ String tableName = tableDeletionEntry.getTableName();
+ long matchSize =
+ devicesInFile.stream()
+ .filter(
+ device -> {
+ logger.debug(
+ "device is {}, deviceTable is {},
tableDeletionEntry.getPredicate().matches(device) is {}",
+ device,
+ device.getTableName(),
+ tableDeletionEntry.getPredicate().matches(device));
Review Comment:
Add `if (logger.isDebugEnabled())` to all debug logs for better performance.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]