SilverNarcissus commented on a change in pull request #2405:
URL: https://github.com/apache/iotdb/pull/2405#discussion_r557162098
##########
File path: server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java
##########
@@ -319,35 +360,88 @@ public ServiceType getID() {
return ServiceType.STORAGE_ENGINE_SERVICE;
}
- public StorageGroupProcessor getProcessor(PartialPath path) throws
StorageEngineException {
+ /**
+ * This method is for sync, delete tsfile or sth like them, just get storage
group directly by sg
+ * name
+ *
+ * @param path storage group path
+ * @return storage group processor
+ */
+ public StorageGroupProcessor getProcessorDirectly(PartialPath path)
+ throws StorageEngineException {
PartialPath storageGroupPath;
try {
StorageGroupMNode storageGroupMNode =
IoTDB.metaManager.getStorageGroupNodeByPath(path);
storageGroupPath = storageGroupMNode.getPartialPath();
- StorageGroupProcessor processor = processorMap.get(storageGroupPath);
- if (processor == null) {
+ return getStorageGroupProcessorByPath(storageGroupPath,
storageGroupMNode);
+ } catch (StorageGroupProcessorException | MetadataException e) {
+ throw new StorageEngineException(e);
+ }
+ }
+
+ /**
+ * This method is for insert and query or sth like them, this may get a
virtual storage group
+ *
+ * @param path device path
+ * @return storage group processor
+ */
+ public StorageGroupProcessor getProcessor(PartialPath path) throws
StorageEngineException {
+ try {
+ StorageGroupMNode storageGroupMNode =
IoTDB.metaManager.getStorageGroupNodeByPath(path);
+ return getStorageGroupProcessorByPath(path, storageGroupMNode);
+ } catch (StorageGroupProcessorException | MetadataException e) {
+ throw new StorageEngineException(e);
+ }
+ }
+
+ /**
+ * get storage group processor by path
+ * @param storageGroupPath path of the storage group
+ * @param storageGroupMNode mnode of the storage group
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]