This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 99adc9dae8 Move time partition calculation from StorageEngine to
StorageEngineV2 (#5708)
99adc9dae8 is described below
commit 99adc9dae8b809cd458c3e001b99808dddc84dd5
Author: Haonan <[email protected]>
AuthorDate: Sat Apr 30 23:40:40 2022 +0800
Move time partition calculation from StorageEngine to StorageEngineV2
(#5708)
---
README.md | 2 +-
README_ZH.md | 2 +-
.../db/mpp/sql/planner/plan/node/write/InsertTabletNode.java | 11 +++++------
.../db/mpp/sql/statement/crud/InsertTabletStatement.java | 11 +++++------
4 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/README.md b/README.md
index b4b975abae..928c85950c 100644
--- a/README.md
+++ b/README.md
@@ -28,7 +28,7 @@
[](https://www.apache.org/licenses/LICENSE-2.0.html)


-
+

[](https://lgtm.com/projects/g/apache/iotdb/context:java)
[](https://iotdb.apache.org/)
diff --git a/README_ZH.md b/README_ZH.md
index 830cfdec19..7831b88915 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -28,7 +28,7 @@
[](https://www.apache.org/licenses/LICENSE-2.0.html)


-
+

[](https://lgtm.com/projects/g/apache/iotdb/context:java)
[](https://iotdb.apache.org/)
diff --git
a/server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/write/InsertTabletNode.java
b/server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/write/InsertTabletNode.java
index e4e8e975e2..fb7e05b1ce 100644
---
a/server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/write/InsertTabletNode.java
+++
b/server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/plan/node/write/InsertTabletNode.java
@@ -21,7 +21,6 @@ package org.apache.iotdb.db.mpp.sql.planner.plan.node.write;
import org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet;
import org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
-import org.apache.iotdb.db.engine.StorageEngine;
import org.apache.iotdb.db.engine.StorageEngineV2;
import org.apache.iotdb.db.exception.metadata.DataTypeMismatchException;
import org.apache.iotdb.db.exception.metadata.IllegalPathException;
@@ -206,9 +205,9 @@ public class InsertTabletNode extends InsertNode implements
WALEntryValue {
return Collections.emptyList();
}
long startTime =
- (times[0] / StorageEngine.getTimePartitionInterval())
- * StorageEngine.getTimePartitionInterval(); // included
- long endTime = startTime + StorageEngine.getTimePartitionInterval(); //
excluded
+ (times[0] / StorageEngineV2.getTimePartitionInterval())
+ * StorageEngineV2.getTimePartitionInterval(); // included
+ long endTime = startTime + StorageEngineV2.getTimePartitionInterval(); //
excluded
TTimePartitionSlot timePartitionSlot =
StorageEngineV2.getTimePartitionSlot(times[0]);
int startLoc = 0; // included
@@ -225,8 +224,8 @@ public class InsertTabletNode extends InsertNode implements
WALEntryValue {
startLoc = i;
startTime = endTime;
endTime =
- (times[i] / StorageEngine.getTimePartitionInterval() + 1)
- * StorageEngine.getTimePartitionInterval();
+ (times[i] / StorageEngineV2.getTimePartitionInterval() + 1)
+ * StorageEngineV2.getTimePartitionInterval();
timePartitionSlot = StorageEngineV2.getTimePartitionSlot(times[i]);
}
}
diff --git
a/server/src/main/java/org/apache/iotdb/db/mpp/sql/statement/crud/InsertTabletStatement.java
b/server/src/main/java/org/apache/iotdb/db/mpp/sql/statement/crud/InsertTabletStatement.java
index a0d88e4d84..c833bdf482 100644
---
a/server/src/main/java/org/apache/iotdb/db/mpp/sql/statement/crud/InsertTabletStatement.java
+++
b/server/src/main/java/org/apache/iotdb/db/mpp/sql/statement/crud/InsertTabletStatement.java
@@ -19,7 +19,6 @@
package org.apache.iotdb.db.mpp.sql.statement.crud;
import org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot;
-import org.apache.iotdb.db.engine.StorageEngine;
import org.apache.iotdb.db.engine.StorageEngineV2;
import org.apache.iotdb.db.metadata.path.PartialPath;
import org.apache.iotdb.db.mpp.sql.statement.StatementVisitor;
@@ -71,17 +70,17 @@ public class InsertTabletStatement extends
InsertBaseStatement {
public List<TTimePartitionSlot> getTimePartitionSlots() {
List<TTimePartitionSlot> result = new ArrayList<>();
long startTime =
- (times[0] / StorageEngine.getTimePartitionInterval())
- * StorageEngine.getTimePartitionInterval(); // included
- long endTime = startTime + StorageEngine.getTimePartitionInterval(); //
excluded
+ (times[0] / StorageEngineV2.getTimePartitionInterval())
+ * StorageEngineV2.getTimePartitionInterval(); // included
+ long endTime = startTime + StorageEngineV2.getTimePartitionInterval(); //
excluded
TTimePartitionSlot timePartitionSlot =
StorageEngineV2.getTimePartitionSlot(times[0]);
for (int i = 1; i < times.length; i++) { // times are sorted in session
API.
if (times[i] >= endTime) {
result.add(timePartitionSlot);
// next init
endTime =
- (times[i] / StorageEngine.getTimePartitionInterval() + 1)
- * StorageEngine.getTimePartitionInterval();
+ (times[i] / StorageEngineV2.getTimePartitionInterval() + 1)
+ * StorageEngineV2.getTimePartitionInterval();
timePartitionSlot = StorageEngineV2.getTimePartitionSlot(times[i]);
}
}