You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2022/04/19 11:50:11 UTC

[iotdb] branch xingtanzjr/mpp_issues updated: fix partition field

This is an automated email from the ASF dual-hosted git repository.

xingtanzjr pushed a commit to branch xingtanzjr/mpp_issues
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/xingtanzjr/mpp_issues by this push:
     new 200e66c70b fix partition field
200e66c70b is described below

commit 200e66c70bd5ec7b4c8f8bc6402e253925aae4e6
Author: Jinrui.Zhang <xi...@gmail.com>
AuthorDate: Tue Apr 19 19:49:57 2022 +0800

    fix partition field
---
 .../main/java/org/apache/iotdb/commons/partition/Partition.java   | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/partition/Partition.java b/node-commons/src/main/java/org/apache/iotdb/commons/partition/Partition.java
index 1f3a5a4999..e0c6e53bd1 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/partition/Partition.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/partition/Partition.java
@@ -24,15 +24,17 @@ public abstract class Partition {
   protected String seriesSlotExecutorName;
   protected int seriesPartitionSlotNum;
 
+  private final SeriesPartitionExecutor executor;
+
   public Partition(String seriesSlotExecutorName, int seriesPartitionSlotNum) {
     this.seriesSlotExecutorName = seriesSlotExecutorName;
     this.seriesPartitionSlotNum = seriesPartitionSlotNum;
+    executor =
+        SeriesPartitionExecutor.getSeriesPartitionExecutor(
+            seriesSlotExecutorName, seriesPartitionSlotNum);
   }
 
   protected SeriesPartitionSlot calculateDeviceGroupId(String deviceName) {
-    SeriesPartitionExecutor executor =
-        SeriesPartitionExecutor.getSeriesPartitionExecutor(
-            seriesSlotExecutorName, seriesPartitionSlotNum);
     return executor.getSeriesPartitionSlot(deviceName);
   }
 }