diff --git a/application/src/main/java/org/thingsboard/server/service/install/update/DefaultDataUpdateService.java b/application/src/main/java/org/thingsboard/server/service/install/update/DefaultDataUpdateService.java
index c896e10dc3..31988394ab 100644
--- a/application/src/main/java/org/thingsboard/server/service/install/update/DefaultDataUpdateService.java
+++ b/application/src/main/java/org/thingsboard/server/service/install/update/DefaultDataUpdateService.java
@@ -1,12 +1,12 @@
/**
* Copyright © 2016-2023 The Thingsboard Authors
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -277,6 +277,7 @@ public class DefaultDataUpdateService implements DataUpdateService {
log.error("Unexpected error during rule nodes upgrade: ", e);
}
}
+
private ArrayList getTbVersionedNodes() {
var ruleNodeDefinitions = beanDiscoveryService.discoverBeansByAnnotationType(
org.thingsboard.rule.engine.api.RuleNode.class
diff --git a/dao/src/main/java/org/thingsboard/server/dao/rule/BaseRuleChainService.java b/dao/src/main/java/org/thingsboard/server/dao/rule/BaseRuleChainService.java
index 4cf96dfa0d..8c25a97298 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/rule/BaseRuleChainService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/rule/BaseRuleChainService.java
@@ -1,12 +1,12 @@
/**
* Copyright © 2016-2023 The Thingsboard Authors
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -207,14 +207,14 @@ public class BaseRuleChainService extends AbstractEntityService implements RuleC
TbPair upgradeResult = tbVersionedNode.upgrade(fromVersion, node.getConfiguration());
if (upgradeResult.getFirst()) {
node.setConfiguration(upgradeResult.getSecond());
- log.info("Successfully upgrade rule node with id: {} type: {}, rule chain id: {} fromVersion: {} toVersion: {}",
- ruleNodeId,
- ruleNodeType,
- ruleChainId,
- fromVersion,
- toVersion);
}
node.setConfigurationVersion(toVersion);
+ log.debug("Successfully upgrade rule node with id: {} type: {}, rule chain id: {} fromVersion: {} toVersion: {}",
+ ruleNodeId,
+ ruleNodeType,
+ ruleChainId,
+ fromVersion,
+ toVersion);
} catch (TbNodeException e) {
log.warn("Failed to upgrade rule node with id: {} type: {} rule chain id: {} fromVersion: {} toVersion: {} due to: ",
ruleNodeId,
diff --git a/dao/src/main/java/org/thingsboard/server/dao/timeseries/CassandraBaseTimeseriesLatestDao.java b/dao/src/main/java/org/thingsboard/server/dao/timeseries/CassandraBaseTimeseriesLatestDao.java
index 6c093509d0..605e0bb428 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/timeseries/CassandraBaseTimeseriesLatestDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/timeseries/CassandraBaseTimeseriesLatestDao.java
@@ -75,7 +75,7 @@ public class CassandraBaseTimeseriesLatestDao extends AbstractCassandraBaseTimes
try {
return findLatest(tenantId, entityId, key, rs -> convertResultToTsKvEntry(key, rs.one())).get();
} catch (InterruptedException | ExecutionException e) {
- log.error("[{}][{}] Failed to get latest entry for key: {}", tenantId, entityId, key, e);
+ log.error("[{}][{}] Failed to get latest entry for key: {} due to: ", tenantId, entityId, key, e);
throw new RuntimeException(e);
}
}
diff --git a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbAbstractGetEntityAttrNode.java b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbAbstractGetEntityAttrNode.java
deleted file mode 100644
index 19127ac5bf..0000000000
--- a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbAbstractGetEntityAttrNode.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/**
- * Copyright © 2016-2023 The Thingsboard Authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.thingsboard.rule.engine.metadata;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.MoreExecutors;
-import lombok.extern.slf4j.Slf4j;
-import org.thingsboard.rule.engine.api.TbContext;
-import org.thingsboard.rule.engine.api.TbNodeException;
-import org.thingsboard.rule.engine.api.util.TbNodeUtils;
-import org.thingsboard.rule.engine.util.EntitiesFieldsAsyncLoader;
-import org.thingsboard.server.common.data.id.EntityId;
-import org.thingsboard.server.common.data.id.RuleNodeId;
-import org.thingsboard.server.common.data.kv.KvEntry;
-import org.thingsboard.server.common.data.util.TbPair;
-import org.thingsboard.server.common.msg.TbMsg;
-import org.thingsboard.server.common.msg.TbMsgMetaData;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import static org.thingsboard.common.util.DonAsynchron.withCallback;
-import static org.thingsboard.server.common.data.DataConstants.SERVER_SCOPE;
-
-@Slf4j
-public abstract class TbAbstractGetEntityAttrNode extends TbAbstractNodeWithFetchTo {
-
- protected final static String DATA_TO_FETCH_PROPERTY_NAME = "dataToFetch";
- protected static final String OLD_PROPERTY_NAME = "telemetry";
-
- @Override
- public void onMsg(TbContext ctx, TbMsg msg) {
- var msgDataAsObjectNode = FetchTo.DATA.equals(fetchTo) ? getMsgDataAsObjectNode(msg) : null;
- withCallback(findEntityAsync(ctx, msg.getOriginator()),
- entityId -> getData(ctx, msg, entityId, msgDataAsObjectNode),
- t -> ctx.tellFailure(msg, t), ctx.getDbCallbackExecutor());
- }
-
- protected abstract ListenableFuture findEntityAsync(TbContext ctx, EntityId originator);
-
- protected void checkIfMappingIsNotEmptyOrElseThrow(Map attrMapping) throws TbNodeException {
- if (attrMapping == null || attrMapping.isEmpty()) {
- throw new TbNodeException("At least one mapping entry should be specified!");
- }
- }
-
- protected abstract void checkDataToFetchSupportedOrElseThrow(DataToFetch dataToFetch) throws TbNodeException;
-
- private void getData(TbContext ctx, TbMsg msg, T entityId, ObjectNode msgDataAsJsonNode) {
- var mappingsMap = new HashMap();
- if (DataToFetch.FIELDS.equals(config.getDataToFetch())) {
- config.getAttrMapping().forEach((sourceField, targetKey) -> {
- String patternProcessedTargetKey = TbNodeUtils.processPattern(targetKey, msg);
- mappingsMap.put(sourceField, patternProcessedTargetKey);
- });
- withCallback(collectMappedEntityFieldsAsync(ctx, entityId, mappingsMap),
- targetKeysToSourceValuesMap -> {
- TbMsgMetaData msgMetaData = msg.getMetaData().copy();
- for (var entry : targetKeysToSourceValuesMap.entrySet()) {
- var targetKeyName = entry.getKey();
- var sourceFieldValue = entry.getValue();
- if (FetchTo.DATA.equals(fetchTo)) {
- msgDataAsJsonNode.put(targetKeyName, sourceFieldValue);
- } else if (FetchTo.METADATA.equals(fetchTo)) {
- msgMetaData.putValue(targetKeyName, sourceFieldValue);
- }
- }
- TbMsg outMsg = transformMessage(msg, msgDataAsJsonNode, msgMetaData);
- ctx.tellSuccess(outMsg);
- },
- t -> ctx.tellFailure(msg, t),
- MoreExecutors.directExecutor());
- } else {
- config.getAttrMapping().forEach((sourceKey, targetKey) -> {
- String patternProcessedSourceKey = TbNodeUtils.processPattern(sourceKey, msg);
- String patternProcessedTargetKey = TbNodeUtils.processPattern(targetKey, msg);
- mappingsMap.put(patternProcessedSourceKey, patternProcessedTargetKey);
- });
- var sourceKeys = List.copyOf(mappingsMap.keySet());
- withCallback(DataToFetch.LATEST_TELEMETRY.equals(config.getDataToFetch()) ?
- getLatestTelemetryAsync(ctx, entityId, sourceKeys) :
- getAttributesAsync(ctx, entityId, sourceKeys),
- data -> putDataAndTell(ctx, msg, data, mappingsMap, msgDataAsJsonNode),
- t -> ctx.tellFailure(msg, t),
- MoreExecutors.directExecutor());
- }
-
- }
-
- private ListenableFuture