SilverNarcissus commented on a change in pull request #2405:
URL: https://github.com/apache/iotdb/pull/2405#discussion_r557193609
##########
File path: server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java
##########
@@ -656,21 +802,38 @@ public synchronized boolean deleteAll() {
}
public void setTTL(PartialPath storageGroup, long dataTTL) throws
StorageEngineException {
- StorageGroupProcessor storageGroupProcessor = getProcessor(storageGroup);
- storageGroupProcessor.setDataTTL(dataTTL);
+ // storage group has no data
+ if (!processorMap.containsKey(storageGroup)) {
+ return;
+ }
+
+ for (StorageGroupProcessor storageGroupProcessor :
processorMap.get(storageGroup)
+ .getAllVirutalStorageGroupProcessor()) {
+ if (storageGroupProcessor != null) {
+ storageGroupProcessor.setDataTTL(dataTTL);
+ }
+ }
}
public void deleteStorageGroup(PartialPath storageGroupPath) {
+ if (!processorMap.containsKey(storageGroupPath)) {
+ return;
+ }
+
deleteAllDataFilesInOneStorageGroup(storageGroupPath);
- StorageGroupProcessor processor = processorMap.remove(storageGroupPath);
- if (processor != null) {
- processor.deleteFolder(systemDir);
+ VirtualStorageGroupManager virtualStorageGroupManager =
processorMap.remove(storageGroupPath);
+ for (StorageGroupProcessor processor : virtualStorageGroupManager
+ .getAllVirutalStorageGroupProcessor()) {
+ if (processor != null) {
+ processor.deleteFolder(systemDir + File.pathSeparator +
storageGroupPath);
+ }
}
}
public void loadNewTsFileForSync(TsFileResource newTsFileResource)
throws StorageEngineException, LoadFileException, IllegalPathException {
- getProcessor(new
PartialPath(newTsFileResource.getTsFile().getParentFile().getName()))
+ getProcessorDirectly(new PartialPath(
+
newTsFileResource.getTsFile().getParentFile().getParentFile().getParentFile().getName()))
Review comment:
fixed~
----------------------------------------------------------------
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]