You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2023/05/17 09:49:17 UTC
[iotdb] 01/01: Optimize getDataRegionReplicaSetForWriting method in DataRartition
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch opt_getDataRegionReplicaSetForWriting
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 5fbea97f8a126eeada0078925731a48d851b3f61
Author: HTHou <hh...@outlook.com>
AuthorDate: Wed May 17 17:48:30 2023 +0800
Optimize getDataRegionReplicaSetForWriting method in DataRartition
---
.../main/java/org/apache/iotdb/commons/partition/DataPartition.java | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
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 f25f0a928f..9b5cf4ed6d 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
@@ -122,10 +122,7 @@ public class DataPartition extends Partition {
"Database not exists and failed to create automatically because enable_auto_create_schema is FALSE.");
}
List<TRegionReplicaSet> regions =
- dataPartitionMap.get(storageGroup).get(seriesPartitionSlot).entrySet().stream()
- .filter(entry -> entry.getKey().equals(timePartitionSlot))
- .flatMap(entry -> entry.getValue().stream())
- .collect(Collectors.toList());
+ dataPartitionMap.get(storageGroup).get(seriesPartitionSlot).get(timePartitionSlot);
// IMPORTANT TODO: (xingtanzjr) need to handle the situation for write operation that there
// are more than 1 Regions for one timeSlot
return regions.get(0);