You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2020/11/02 10:33:59 UTC
[iotdb] branch shield_mqtt_log updated: add log for mqtt
This is an automated email from the ASF dual-hosted git repository.
qiaojialin pushed a commit to branch shield_mqtt_log
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/shield_mqtt_log by this push:
new 7df6ba0 add log for mqtt
7df6ba0 is described below
commit 7df6ba0ec21b44f06fcfe84df39add261ccea2bc
Author: qiaojialin <64...@qq.com>
AuthorDate: Mon Nov 2 18:33:25 2020 +0800
add log for mqtt
---
.../org/apache/iotdb/db/mqtt/PublishHandler.java | 2 +-
.../apache/iotdb/db/qp/executor/PlanExecutor.java | 26 +++++++++++++---------
2 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/mqtt/PublishHandler.java b/server/src/main/java/org/apache/iotdb/db/mqtt/PublishHandler.java
index 9f6c71c..b0b8495 100644
--- a/server/src/main/java/org/apache/iotdb/db/mqtt/PublishHandler.java
+++ b/server/src/main/java/org/apache/iotdb/db/mqtt/PublishHandler.java
@@ -98,7 +98,7 @@ public class PublishHandler extends AbstractInterceptHandler {
try {
plan.setDeviceId(new PartialPath(event.getDevice()));
status = executeNonQuery(plan);
- } catch (QueryProcessException | StorageGroupNotSetException | StorageEngineException | IllegalPathException e ) {
+ } catch (Exception e) {
LOG.warn(
"meet error when inserting device {}, measurements {}, at time {}, because ",
event.getDevice(), event.getMeasurements(), event.getTimestamp(), e);
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java b/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
index db3e52a..0933877 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
@@ -909,26 +909,30 @@ public class PlanExecutor implements IPlanExecutor {
}
}
- private MNode getSeriesSchemas(InsertPlan insertPlan)
- throws MetadataException {
- return IoTDB.metaManager
- .getSeriesSchemasAndReadLockDevice(insertPlan);
+ private MNode getSeriesSchemas(InsertPlan insertPlan) throws MetadataException {
+ return IoTDB.metaManager.getSeriesSchemasAndReadLockDevice(insertPlan);
}
@Override
public void insert(InsertRowPlan insertRowPlan) throws QueryProcessException {
try {
- insertRowPlan
- .setMeasurementMNodes(new MeasurementMNode[insertRowPlan.getMeasurements().length]);
- getSeriesSchemas(insertRowPlan);
- insertRowPlan.transferType();
- //check insert plan
+ // check insert plan
+ if (insertRowPlan.getMeasurements() == null) {
+ throw new QueryProcessException(
+ "The measurements of InsertRowPlan is null, deviceId:" + insertRowPlan.getDeviceId()
+ + ", time:" + insertRowPlan.getTime());
+ }
if (insertRowPlan.getValues().length == 0) {
- logger.warn("Can't insert row with only time/timestamp");
- return;
+ throw new QueryProcessException(
+ "The size of values in this InsertRowPlan is 0, deviceId:" + insertRowPlan.getDeviceId()
+ + ", time:" + insertRowPlan.getTime());
}
+ insertRowPlan
+ .setMeasurementMNodes(new MeasurementMNode[insertRowPlan.getMeasurements().length]);
+ getSeriesSchemas(insertRowPlan);
+ insertRowPlan.transferType();
StorageEngine.getInstance().insert(insertRowPlan);
if (insertRowPlan.getFailedMeasurements() != null) {
// check if all path not exist exceptions