From 6e68b351b824fe817f84104e9bf866e94eb39533 Mon Sep 17 00:00:00 2001 From: stormbroken <181250184@smail.nju.edu.cn> Date: Fri, 10 Jun 2022 10:03:54 +0800 Subject: [PATCH 1/5] for timeseries root.test.s1, device name can be equaled to storage group name. --- .../org/apache/iotdb/confignode/manager/ConfigManager.java | 4 ++-- .../org/apache/iotdb/commons/partition/SchemaPartition.java | 2 +- .../iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java index a6d9797b8dc70..b8f8655b4dec3 100644 --- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java +++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java @@ -291,7 +291,7 @@ public DataSet getSchemaPartition(PathPatternTree patternTree) { for (String devicePath : devicePaths) { boolean matchStorageGroup = false; for (String storageGroup : storageGroups) { - if (devicePath.startsWith(storageGroup + ".")) { + if (devicePath.startsWith(storageGroup)) { matchStorageGroup = true; if (devicePath.contains("*")) { // Get all SchemaPartitions of this StorageGroup if the devicePath contains "*" @@ -352,7 +352,7 @@ public DataSet getOrCreateSchemaPartition(PathPatternTree patternTree) { if (!devicePath.contains("*")) { // Only check devicePaths that without "*" for (String storageGroup : storageGroups) { - if (devicePath.startsWith(storageGroup + ".")) { + if (devicePath.startsWith(storageGroup)) { partitionSlotsMap .computeIfAbsent(storageGroup, key -> new ArrayList<>()) .add(getPartitionManager().getSeriesPartitionSlot(devicePath)); diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartition.java b/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartition.java index acc4174e64523..ae978ad52d634 100644 --- a/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartition.java +++ b/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartition.java @@ -77,7 +77,7 @@ public TRegionReplicaSet getSchemaRegionReplicaSet(String deviceName) { private String getStorageGroupByDevice(String deviceName) { for (String storageGroup : schemaPartitionMap.keySet()) { - if (deviceName.startsWith(storageGroup + ".")) { + if (deviceName.startsWith(storageGroup)) { return storageGroup; } } diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java index 1470daf66a6bc..cac422c765e9b 100644 --- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java +++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java @@ -460,7 +460,7 @@ public boolean getStorageGroup( for (String devicePath : devicePaths) { boolean hit = false; for (String storageGroup : storageGroupCache) { - if (devicePath.startsWith(storageGroup + ".")) { + if (devicePath.startsWith(storageGroup)) { deviceToStorageGroupMap.put(devicePath, storageGroup); hit = true; break; From f9fedda9394bf001a188af292fbb82f74eddad92 Mon Sep 17 00:00:00 2001 From: stormbroken <181250184@smail.nju.edu.cn> Date: Fri, 10 Jun 2022 10:43:03 +0800 Subject: [PATCH 2/5] extends storage group match. --- .../org/apache/iotdb/confignode/manager/ConfigManager.java | 4 ++-- .../org/apache/iotdb/commons/partition/SchemaPartition.java | 2 +- .../iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java index b8f8655b4dec3..9516944edb530 100644 --- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java +++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java @@ -291,7 +291,7 @@ public DataSet getSchemaPartition(PathPatternTree patternTree) { for (String devicePath : devicePaths) { boolean matchStorageGroup = false; for (String storageGroup : storageGroups) { - if (devicePath.startsWith(storageGroup)) { + if (devicePath.equals(storageGroup) || devicePath.startsWith(storageGroup + ".")) { matchStorageGroup = true; if (devicePath.contains("*")) { // Get all SchemaPartitions of this StorageGroup if the devicePath contains "*" @@ -352,7 +352,7 @@ public DataSet getOrCreateSchemaPartition(PathPatternTree patternTree) { if (!devicePath.contains("*")) { // Only check devicePaths that without "*" for (String storageGroup : storageGroups) { - if (devicePath.startsWith(storageGroup)) { + if (devicePath.equals(storageGroup) || devicePath.startsWith(storageGroup + ".")) { partitionSlotsMap .computeIfAbsent(storageGroup, key -> new ArrayList<>()) .add(getPartitionManager().getSeriesPartitionSlot(devicePath)); diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartition.java b/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartition.java index ae978ad52d634..2462bc9c16e9c 100644 --- a/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartition.java +++ b/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartition.java @@ -77,7 +77,7 @@ public TRegionReplicaSet getSchemaRegionReplicaSet(String deviceName) { private String getStorageGroupByDevice(String deviceName) { for (String storageGroup : schemaPartitionMap.keySet()) { - if (deviceName.startsWith(storageGroup)) { + if (deviceName.equals(storageGroup) || deviceName.startsWith(storageGroup + ".")) { return storageGroup; } } diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java index cac422c765e9b..70011aa35fdf0 100644 --- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java +++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java @@ -460,7 +460,7 @@ public boolean getStorageGroup( for (String devicePath : devicePaths) { boolean hit = false; for (String storageGroup : storageGroupCache) { - if (devicePath.startsWith(storageGroup)) { + if (devicePath.equals(storageGroup) || devicePath.startsWith(storageGroup + ".")) { deviceToStorageGroupMap.put(devicePath, storageGroup); hit = true; break; From ad8483004cc0acf99d01138768b266eb6946411f Mon Sep 17 00:00:00 2001 From: stormbroken <181250184@smail.nju.edu.cn> Date: Mon, 13 Jun 2022 09:05:16 +0800 Subject: [PATCH 3/5] extends storage group match. --- .../org/apache/iotdb/confignode/manager/ConfigManager.java | 5 +++-- .../org/apache/iotdb/commons/partition/DataPartition.java | 3 ++- .../main/java/org/apache/iotdb/commons/utils/PathUtils.java | 4 ++++ .../apache/iotdb/db/mpp/common/schematree/SchemaTree.java | 3 ++- .../iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java | 5 +++-- .../db/mpp/plan/analyze/StandalonePartitionFetcher.java | 3 ++- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java index 3584db8899c9e..76b0ad5fd52b4 100644 --- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java +++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java @@ -24,6 +24,7 @@ import org.apache.iotdb.commons.conf.CommonDescriptor; import org.apache.iotdb.commons.path.PartialPath; import org.apache.iotdb.commons.utils.AuthUtils; +import org.apache.iotdb.commons.utils.PathUtils; import org.apache.iotdb.confignode.conf.ConfigNodeConf; import org.apache.iotdb.confignode.conf.ConfigNodeDescriptor; import org.apache.iotdb.confignode.consensus.request.ConfigRequest; @@ -281,7 +282,7 @@ public DataSet getSchemaPartition(PathPatternTree patternTree) { for (String devicePath : devicePaths) { boolean matchStorageGroup = false; for (String storageGroup : storageGroups) { - if (devicePath.equals(storageGroup) || devicePath.startsWith(storageGroup + ".")) { + if (PathUtils.match(devicePath, storageGroup)) { matchStorageGroup = true; if (devicePath.contains("*")) { // Get all SchemaPartitions of this StorageGroup if the devicePath contains "*" @@ -342,7 +343,7 @@ public DataSet getOrCreateSchemaPartition(PathPatternTree patternTree) { if (!devicePath.contains("*")) { // Only check devicePaths that without "*" for (String storageGroup : storageGroups) { - if (devicePath.equals(storageGroup) || devicePath.startsWith(storageGroup + ".")) { + if (PathUtils.match(devicePath, storageGroup)) { partitionSlotsMap .computeIfAbsent(storageGroup, key -> new ArrayList<>()) .add(getPartitionManager().getSeriesPartitionSlot(devicePath)); diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/partition/DataPartition.java b/node-commons/src/main/java/org/apache/iotdb/commons/partition/DataPartition.java index e1004d7445d2a..65559c58a83ef 100644 --- a/node-commons/src/main/java/org/apache/iotdb/commons/partition/DataPartition.java +++ b/node-commons/src/main/java/org/apache/iotdb/commons/partition/DataPartition.java @@ -21,6 +21,7 @@ import org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet; import org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot; import org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot; +import org.apache.iotdb.commons.utils.PathUtils; import java.util.ArrayList; import java.util.Collection; @@ -114,7 +115,7 @@ public TRegionReplicaSet getDataRegionReplicaSetForWriting( private String getStorageGroupByDevice(String deviceName) { for (String storageGroup : dataPartitionMap.keySet()) { - if (deviceName.startsWith(storageGroup + ".")) { + if (PathUtils.match(deviceName, storageGroup)) { return storageGroup; } } diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/utils/PathUtils.java b/node-commons/src/main/java/org/apache/iotdb/commons/utils/PathUtils.java index a886350498fe1..75d3fd7f370e0 100644 --- a/node-commons/src/main/java/org/apache/iotdb/commons/utils/PathUtils.java +++ b/node-commons/src/main/java/org/apache/iotdb/commons/utils/PathUtils.java @@ -126,6 +126,10 @@ public static void isLegalMeasurements(List measurements) throws Illegal } } + public static boolean match(String deviceName, String storageGroup) { + return deviceName.equals(storageGroup) || deviceName.startsWith(storageGroup + "."); + } + private static boolean checkBackQuotes(String src) { int num = src.length() - src.replace("`", "").length(); if (num % 2 == 1) { diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/common/schematree/SchemaTree.java b/server/src/main/java/org/apache/iotdb/db/mpp/common/schematree/SchemaTree.java index 8c3e307b584d3..48536c2a6b70b 100644 --- a/server/src/main/java/org/apache/iotdb/db/mpp/common/schematree/SchemaTree.java +++ b/server/src/main/java/org/apache/iotdb/db/mpp/common/schematree/SchemaTree.java @@ -20,6 +20,7 @@ package org.apache.iotdb.db.mpp.common.schematree; import org.apache.iotdb.commons.path.PartialPath; +import org.apache.iotdb.commons.utils.PathUtils; import org.apache.iotdb.commons.utils.TestOnly; import org.apache.iotdb.db.conf.IoTDBDescriptor; import org.apache.iotdb.db.metadata.path.MeasurementPath; @@ -267,7 +268,7 @@ public static SchemaTree deserialize(ByteBuffer buffer) { */ public String getBelongedStorageGroup(String pathName) { for (String storageGroup : storageGroups) { - if (pathName.startsWith(storageGroup + ".")) { + if (PathUtils.match(pathName, storageGroup)) { return storageGroup; } } diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java index 70011aa35fdf0..75a6f6a6591dc 100644 --- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java +++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java @@ -30,6 +30,7 @@ import org.apache.iotdb.commons.partition.SchemaPartition; import org.apache.iotdb.commons.partition.executor.SeriesPartitionExecutor; import org.apache.iotdb.commons.path.PartialPath; +import org.apache.iotdb.commons.utils.PathUtils; import org.apache.iotdb.confignode.rpc.thrift.TDataPartitionReq; import org.apache.iotdb.confignode.rpc.thrift.TDataPartitionResp; import org.apache.iotdb.confignode.rpc.thrift.TSchemaNodeManagementReq; @@ -460,7 +461,7 @@ public boolean getStorageGroup( for (String devicePath : devicePaths) { boolean hit = false; for (String storageGroup : storageGroupCache) { - if (devicePath.equals(storageGroup) || devicePath.startsWith(storageGroup + ".")) { + if (PathUtils.match(devicePath, storageGroup)) { deviceToStorageGroupMap.put(devicePath, storageGroup); hit = true; break; @@ -597,7 +598,7 @@ public void updateSchemaPartitionCache(List devices, SchemaPartition sch if (!device.contains("*")) { String storageGroup = null; for (String storageGroupName : storageGroupNames) { - if (device.startsWith(storageGroupName + ".")) { + if (PathUtils.match(device, storageGroup)) { storageGroup = storageGroupName; break; } diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/StandalonePartitionFetcher.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/StandalonePartitionFetcher.java index 5f291684b1daf..64fdeedd9ed7d 100644 --- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/StandalonePartitionFetcher.java +++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/StandalonePartitionFetcher.java @@ -25,6 +25,7 @@ import org.apache.iotdb.commons.partition.SchemaPartition; import org.apache.iotdb.commons.partition.executor.SeriesPartitionExecutor; import org.apache.iotdb.commons.path.PartialPath; +import org.apache.iotdb.commons.utils.PathUtils; import org.apache.iotdb.db.conf.IoTDBConfig; import org.apache.iotdb.db.conf.IoTDBDescriptor; import org.apache.iotdb.db.engine.StorageEngineV2; @@ -169,7 +170,7 @@ private Map getDeviceToStorageGroup( List allStorageGroups = localConfigNode.getAllStorageGroupPaths(); for (String devicePath : devicePaths) { for (PartialPath storageGroup : allStorageGroups) { - if (devicePath.startsWith(storageGroup.getFullPath() + ".")) { + if (PathUtils.match(devicePath, storageGroup.getFullPath())) { deviceToStorageGroup.put(devicePath, storageGroup.getFullPath()); } } From 0ebea5059b8b60046f1b76fd009265226eadf7d0 Mon Sep 17 00:00:00 2001 From: stormbroken <181250184@smail.nju.edu.cn> Date: Mon, 13 Jun 2022 11:29:04 +0800 Subject: [PATCH 4/5] fix --- .../org/apache/iotdb/commons/partition/SchemaPartition.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartition.java b/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartition.java index 1c3f0c0494e57..bee851d58ac2d 100644 --- a/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartition.java +++ b/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartition.java @@ -20,6 +20,7 @@ import org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet; import org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot; +import org.apache.iotdb.commons.utils.PathUtils; import java.util.ArrayList; import java.util.HashMap; @@ -69,7 +70,7 @@ public TRegionReplicaSet getSchemaRegionReplicaSet(String deviceName) { private String getStorageGroupByDevice(String deviceName) { for (String storageGroup : schemaPartitionMap.keySet()) { - if (deviceName.equals(storageGroup) || deviceName.startsWith(storageGroup + ".")) { + if (PathUtils.match(deviceName, storageGroup)) { return storageGroup; } } From 969703b7a175e36b10e7fe6208026770b5e1c434 Mon Sep 17 00:00:00 2001 From: stormbroken <181250184@smail.nju.edu.cn> Date: Mon, 13 Jun 2022 21:11:20 +0800 Subject: [PATCH 5/5] fix name. --- .../org/apache/iotdb/confignode/manager/ConfigManager.java | 4 ++-- .../org/apache/iotdb/commons/partition/DataPartition.java | 2 +- .../org/apache/iotdb/commons/partition/SchemaPartition.java | 2 +- .../main/java/org/apache/iotdb/commons/utils/PathUtils.java | 2 +- .../org/apache/iotdb/db/mpp/common/schematree/SchemaTree.java | 2 +- .../iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java | 4 ++-- .../iotdb/db/mpp/plan/analyze/StandalonePartitionFetcher.java | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java index 76b0ad5fd52b4..c75db5a5a2eb8 100644 --- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java +++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java @@ -282,7 +282,7 @@ public DataSet getSchemaPartition(PathPatternTree patternTree) { for (String devicePath : devicePaths) { boolean matchStorageGroup = false; for (String storageGroup : storageGroups) { - if (PathUtils.match(devicePath, storageGroup)) { + if (PathUtils.isStartWith(devicePath, storageGroup)) { matchStorageGroup = true; if (devicePath.contains("*")) { // Get all SchemaPartitions of this StorageGroup if the devicePath contains "*" @@ -343,7 +343,7 @@ public DataSet getOrCreateSchemaPartition(PathPatternTree patternTree) { if (!devicePath.contains("*")) { // Only check devicePaths that without "*" for (String storageGroup : storageGroups) { - if (PathUtils.match(devicePath, storageGroup)) { + if (PathUtils.isStartWith(devicePath, storageGroup)) { partitionSlotsMap .computeIfAbsent(storageGroup, key -> new ArrayList<>()) .add(getPartitionManager().getSeriesPartitionSlot(devicePath)); diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/partition/DataPartition.java b/node-commons/src/main/java/org/apache/iotdb/commons/partition/DataPartition.java index 65559c58a83ef..9523e22482ec8 100644 --- a/node-commons/src/main/java/org/apache/iotdb/commons/partition/DataPartition.java +++ b/node-commons/src/main/java/org/apache/iotdb/commons/partition/DataPartition.java @@ -115,7 +115,7 @@ public TRegionReplicaSet getDataRegionReplicaSetForWriting( private String getStorageGroupByDevice(String deviceName) { for (String storageGroup : dataPartitionMap.keySet()) { - if (PathUtils.match(deviceName, storageGroup)) { + if (PathUtils.isStartWith(deviceName, storageGroup)) { return storageGroup; } } diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartition.java b/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartition.java index bee851d58ac2d..f9ed307c6908e 100644 --- a/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartition.java +++ b/node-commons/src/main/java/org/apache/iotdb/commons/partition/SchemaPartition.java @@ -70,7 +70,7 @@ public TRegionReplicaSet getSchemaRegionReplicaSet(String deviceName) { private String getStorageGroupByDevice(String deviceName) { for (String storageGroup : schemaPartitionMap.keySet()) { - if (PathUtils.match(deviceName, storageGroup)) { + if (PathUtils.isStartWith(deviceName, storageGroup)) { return storageGroup; } } diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/utils/PathUtils.java b/node-commons/src/main/java/org/apache/iotdb/commons/utils/PathUtils.java index 75d3fd7f370e0..474010392c345 100644 --- a/node-commons/src/main/java/org/apache/iotdb/commons/utils/PathUtils.java +++ b/node-commons/src/main/java/org/apache/iotdb/commons/utils/PathUtils.java @@ -126,7 +126,7 @@ public static void isLegalMeasurements(List measurements) throws Illegal } } - public static boolean match(String deviceName, String storageGroup) { + public static boolean isStartWith(String deviceName, String storageGroup) { return deviceName.equals(storageGroup) || deviceName.startsWith(storageGroup + "."); } diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/common/schematree/SchemaTree.java b/server/src/main/java/org/apache/iotdb/db/mpp/common/schematree/SchemaTree.java index 48536c2a6b70b..e30d650140d03 100644 --- a/server/src/main/java/org/apache/iotdb/db/mpp/common/schematree/SchemaTree.java +++ b/server/src/main/java/org/apache/iotdb/db/mpp/common/schematree/SchemaTree.java @@ -268,7 +268,7 @@ public static SchemaTree deserialize(ByteBuffer buffer) { */ public String getBelongedStorageGroup(String pathName) { for (String storageGroup : storageGroups) { - if (PathUtils.match(pathName, storageGroup)) { + if (PathUtils.isStartWith(pathName, storageGroup)) { return storageGroup; } } diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java index 75a6f6a6591dc..5da5985d80290 100644 --- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java +++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ClusterPartitionFetcher.java @@ -461,7 +461,7 @@ public boolean getStorageGroup( for (String devicePath : devicePaths) { boolean hit = false; for (String storageGroup : storageGroupCache) { - if (PathUtils.match(devicePath, storageGroup)) { + if (PathUtils.isStartWith(devicePath, storageGroup)) { deviceToStorageGroupMap.put(devicePath, storageGroup); hit = true; break; @@ -598,7 +598,7 @@ public void updateSchemaPartitionCache(List devices, SchemaPartition sch if (!device.contains("*")) { String storageGroup = null; for (String storageGroupName : storageGroupNames) { - if (PathUtils.match(device, storageGroup)) { + if (PathUtils.isStartWith(device, storageGroup)) { storageGroup = storageGroupName; break; } diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/StandalonePartitionFetcher.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/StandalonePartitionFetcher.java index 64fdeedd9ed7d..d389e124f3f7e 100644 --- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/StandalonePartitionFetcher.java +++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/StandalonePartitionFetcher.java @@ -170,7 +170,7 @@ private Map getDeviceToStorageGroup( List allStorageGroups = localConfigNode.getAllStorageGroupPaths(); for (String devicePath : devicePaths) { for (PartialPath storageGroup : allStorageGroups) { - if (PathUtils.match(devicePath, storageGroup.getFullPath())) { + if (PathUtils.isStartWith(devicePath, storageGroup.getFullPath())) { deviceToStorageGroup.put(devicePath, storageGroup.getFullPath()); } }