improve node details and add license for test class

This commit is contained in:
van-vanich 2022-01-05 14:48:45 +02:00
parent bb3c730e58
commit 2bdc1860a8
2 changed files with 25 additions and 5 deletions

View File

@ -1,3 +1,18 @@
/**
* Copyright © 2016-2021 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.server.service.sql; package org.thingsboard.server.service.sql;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;

View File

@ -46,10 +46,15 @@ import java.util.concurrent.TimeUnit;
configClazz = TbMsgTimeseriesNodeConfiguration.class, configClazz = TbMsgTimeseriesNodeConfiguration.class,
nodeDescription = "Saves timeseries data", nodeDescription = "Saves timeseries data",
nodeDetails = "Saves timeseries telemetry data based on configurable TTL parameter. Expects messages with 'POST_TELEMETRY_REQUEST' message type. " + nodeDetails = "Saves timeseries telemetry data based on configurable TTL parameter. Expects messages with 'POST_TELEMETRY_REQUEST' message type. " +
"Timestamp in milliseconds will be taken from metadata.ts, otherwise 'now' timestamp will be applied. " + "Timestamp in milliseconds will be taken from metadata.ts, otherwise 'now' message timestamp will be applied. " +
"Allows stopping updating values for incoming keys in the latest ts_kv table if 'skipLatestPersistence' is set to true.", "Allows stopping updating values for incoming keys in the latest ts_kv table if 'skipLatestPersistence' is set to true.\n " +
"Enable 'ignoreMetadataTs' param to ignore the timestamp that arrives from message metadata. " +
"Useful for all sorts of sequential processing if you merge messages from multiple sources (devices, assets, etc).\n" +
"For example, if you count number of messages from multiple devices into asset time-series value. " +
"Typically, you fetch the previous value of the counter, increment it and then save the value. " +
"If you use timestamp of the original message, the value may be ignored, since it has outdated timestamp comparing to the previous message.",
uiResources = {"static/rulenode/rulenode-core-config.js"}, uiResources = {"static/rulenode/rulenode-core-config.js"},
configDirective = "tbActionNodeTimeseriesConfig!", configDirective = "tbActionNodeTimeseriesConfig",
icon = "file_upload" icon = "file_upload"
) )
public class TbMsgTimeseriesNode implements TbNode { public class TbMsgTimeseriesNode implements TbNode {
@ -102,8 +107,8 @@ public class TbMsgTimeseriesNode implements TbNode {
} }
} }
public static long computeTs(TbMsg msg, boolean saveWithMsgTs) { public static long computeTs(TbMsg msg, boolean ignoreMetadataTs) {
return saveWithMsgTs ? System.currentTimeMillis() : getTs(msg); return ignoreMetadataTs ? System.currentTimeMillis() : getTs(msg);
} }
public static long getTs(TbMsg msg) { public static long getTs(TbMsg msg) {