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/01/31 05:53:15 UTC
[iotdb] 01/01: add log
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch geely_car
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit a42f19adafdf6302888bc6205ac0137962978877
Author: HTHou <hh...@outlook.com>
AuthorDate: Tue Jan 31 13:52:58 2023 +0800
add log
---
.../iotdb/commons/partition/DataPartition.java | 20 +++++++++++++++-----
.../java/org/apache/iotdb/db/conf/IoTDBConfig.java | 2 +-
2 files changed, 16 insertions(+), 6 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..37df4c8aa2 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
@@ -121,11 +121,21 @@ public class DataPartition extends Partition {
throw new RuntimeException(
"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());
+ // List<TRegionReplicaSet> regions =
+ // dataPartitionMap.get(storageGroup).get(seriesPartitionSlot).entrySet().stream()
+ // .filter(entry -> entry.getKey().equals(timePartitionSlot))
+ // .flatMap(entry -> entry.getValue().stream())
+ // .collect(Collectors.toList());
+ Map<TSeriesPartitionSlot, Map<TTimePartitionSlot, List<TRegionReplicaSet>>>
+ dataBasePartitionMap = dataPartitionMap.get(storageGroup);
+ Map<TTimePartitionSlot, List<TRegionReplicaSet>> slotReplicaSetMap =
+ dataBasePartitionMap.get(seriesPartitionSlot);
+ List<TRegionReplicaSet> regions = slotReplicaSetMap.get(timePartitionSlot);
+ if (regions == null || regions.isEmpty()) {
+ throw new RuntimeException(
+ String.format(
+ "region is %s, device: %s, timeSlot: %s", regions, deviceName, 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);
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
index e5092a0b1f..c44a1b81dc 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
@@ -875,7 +875,7 @@ public class IoTDBConfig {
* series partition
*/
private String seriesPartitionExecutorClass =
- "org.apache.iotdb.commons.partition.executor.hash.APHashExecutor";
+ "org.apache.iotdb.commons.partition.executor.hash.BKDRHashExecutor";
/** The number of series partitions in a database */
private int seriesPartitionSlotNum = 10000;