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 79f4b4b Fix CI failed caused by updating unnecessary vector last
cache (#3044)
79f4b4b is described below
commit 79f4b4bac6deccb2c05607aaeeaa35935e61fc72
Author: Haonan <[email protected]>
AuthorDate: Thu Apr 22 11:35:09 2021 +0800
Fix CI failed caused by updating unnecessary vector last cache (#3044)
---
.../engine/storagegroup/StorageGroupProcessor.java | 79 +++++++++++++---------
.../iotdb/db/qp/physical/crud/InsertRowPlan.java | 11 ++-
2 files changed, 52 insertions(+), 38 deletions(-)
diff --git
a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
index 5dfead5..4d499fa 100755
---
a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
+++
b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
@@ -73,6 +73,7 @@ import org.apache.iotdb.rpc.RpcUtils;
import org.apache.iotdb.rpc.TSStatusCode;
import org.apache.iotdb.service.rpc.thrift.TSStatus;
import org.apache.iotdb.tsfile.file.metadata.ChunkMetadata;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
import org.apache.iotdb.tsfile.fileSystem.FSFactoryProducer;
import org.apache.iotdb.tsfile.fileSystem.fsFactory.FSFactory;
import org.apache.iotdb.tsfile.read.TimeValuePair;
@@ -1028,24 +1029,32 @@ public class StorageGroupProcessor {
return;
}
MeasurementMNode[] mNodes = plan.getMeasurementMNodes();
+ int columnIndex = 0;
for (int i = 0; i < mNodes.length; i++) {
- if (plan.getColumns()[i] == null) {
- continue;
- }
- // Update cached last value with high priority
- if (mNodes[i] != null) {
- // in stand alone version, the seriesPath is not needed, just use
measurementMNodes[i] to
- // update last cache
- IoTDB.metaManager.updateLastCache(
- null, plan.composeLastTimeValuePair(i), true, latestFlushedTime,
mNodes[i]);
+ // Don't update cached last value for vector type
+ if (mNodes[i] != null && mNodes[i].getSchema().getType() ==
TSDataType.VECTOR) {
+ columnIndex +=
mNodes[i].getSchema().getValueMeasurementIdList().size();
} else {
- // measurementMNodes[i] is null, use the path to update remote cache
- IoTDB.metaManager.updateLastCache(
- plan.getDeviceId().concatNode(plan.getMeasurements()[i]),
- plan.composeLastTimeValuePair(i),
- true,
- latestFlushedTime,
- null);
+ if (plan.getColumns()[i] == null) {
+ columnIndex++;
+ continue;
+ }
+ // Update cached last value with high priority
+ if (mNodes[i] != null) {
+ // in stand alone version, the seriesPath is not needed, just use
measurementMNodes[i] to
+ // update last cache
+ IoTDB.metaManager.updateLastCache(
+ null, plan.composeLastTimeValuePair(columnIndex), true,
latestFlushedTime, mNodes[i]);
+ } else {
+ // measurementMNodes[i] is null, use the path to update remote cache
+ IoTDB.metaManager.updateLastCache(
+
plan.getDeviceId().concatNode(plan.getMeasurements()[columnIndex]),
+ plan.composeLastTimeValuePair(columnIndex),
+ true,
+ latestFlushedTime,
+ null);
+ }
+ columnIndex++;
}
}
}
@@ -1087,23 +1096,31 @@ public class StorageGroupProcessor {
return;
}
MeasurementMNode[] mNodes = plan.getMeasurementMNodes();
+ int columnIndex = 0;
for (int i = 0; i < mNodes.length; i++) {
- if (plan.getValues()[i] == null) {
- continue;
- }
- // Update cached last value with high priority
- if (mNodes[i] != null) {
- // in stand alone version, the seriesPath is not needed, just use
measurementMNodes[i] to
- // update last cache
- IoTDB.metaManager.updateLastCache(
- null, plan.composeTimeValuePair(i), true, latestFlushedTime,
mNodes[i]);
+ // Don't update cached last value for vector type
+ if (mNodes[i] != null && mNodes[i].getSchema().getType() ==
TSDataType.VECTOR) {
+ columnIndex +=
mNodes[i].getSchema().getValueMeasurementIdList().size();
} else {
- IoTDB.metaManager.updateLastCache(
- plan.getDeviceId().concatNode(plan.getMeasurements()[i]),
- plan.composeTimeValuePair(i),
- true,
- latestFlushedTime,
- null);
+ if (plan.getValues()[columnIndex] == null) {
+ columnIndex++;
+ continue;
+ }
+ // Update cached last value with high priority
+ if (mNodes[i] != null) {
+ // in stand alone version, the seriesPath is not needed, just use
measurementMNodes[i] to
+ // update last cache
+ IoTDB.metaManager.updateLastCache(
+ null, plan.composeTimeValuePair(columnIndex), true,
latestFlushedTime, mNodes[i]);
+ } else {
+ IoTDB.metaManager.updateLastCache(
+
plan.getDeviceId().concatNode(plan.getMeasurements()[columnIndex]),
+ plan.composeTimeValuePair(columnIndex),
+ true,
+ latestFlushedTime,
+ null);
+ }
+ columnIndex++;
}
}
}
diff --git
a/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertRowPlan.java
b/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertRowPlan.java
index bd0150d..f20b385 100644
---
a/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertRowPlan.java
+++
b/server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertRowPlan.java
@@ -546,15 +546,12 @@ public class InsertRowPlan extends InsertPlan {
return failedValues != null && !failedValues.isEmpty();
}
- public TimeValuePair composeTimeValuePair(int measurementIndex) {
- if (measurementIndex >= values.length) {
+ public TimeValuePair composeTimeValuePair(int columnIndex) {
+ if (columnIndex >= values.length) {
return null;
}
- Object value = values[measurementIndex];
- return new TimeValuePair(
- time,
- TsPrimitiveType.getByType(
- measurementMNodes[measurementIndex].getSchema().getType(), value));
+ Object value = values[columnIndex];
+ return new TimeValuePair(time,
TsPrimitiveType.getByType(dataTypes[columnIndex], value));
}
@Override