Record Generator¶
This stage generates new records based on the specified conditions. The functions of this stage include:
Generating required records by fixed calculation or querying frequency, or by triggering points.
Determining the dataset to be generated for the specific device and point, i.e.,
Map<assetId,Set<pointId>>
, based on the filtering conditions (such as asset ID, model ID, asset tag, asset tree ID, and asset tree tag).
The triggering conditions for generating the records are based on the determined dataset:
Get the record data from Redis based on the fixed query frequency and time interval.
Get the record data from TSDB based on the fixed query frequency and time range.
Simulate the record data of certain types based on the fixed calculation frequency.
Simulate triggering point data based on the fixed calculation frequency.
Configuration¶
The configuration tabs for this stage are General, Basic, Input/Output, and Record Generate.
General¶
Name |
Required? |
Description |
---|---|---|
Name |
Yes |
The name of the stage. |
Description |
No |
The description of the stage. |
Stage Library |
Yes |
The streaming operator library to which the stage belongs. |
Required Fields |
No |
The fields that the data records must contain. If the specified fields are not included, the record will be filtered out. |
Preconditions |
No |
The conditions that must be satisfied by the data records. Records that do not meet the conditions will be filtered out. For example, |
On Record Error |
Yes |
The processing method for error data.
|
Basic¶
Name |
Required? |
Description |
---|---|---|
Trigger Type |
Yes |
Select the method of triggering the data record generation. Options are By Fixed Frequency and By Input Point. |
Trigger Frequency |
Yes |
When you select generating data records by fixed frequency, select the frequency for generating new records. |
Trigger Point |
Yes |
When you select generating data records by input point, enter the name of the triggering point (by the format of pointId, not modelId::pointId). |
Input/Output¶
Name |
Required? |
Description |
---|---|---|
Generate Type |
Yes |
Select the method to generate new records.
|
Output Asset |
No |
When the By AssetIDs method is selected, specify the asset ID. In the Output Point field, specify the measurement point for the generated data records, using the format {pointId}. |
Asset Tag |
No |
When the By Asset Tags method is selected, specify the tag key and value. In the Output Point field, specify the measurement point for the generated data records, using the format {modelId}::{pointId} or {pointId}. |
Tree Selector |
No |
When the By Asset Tree method is selected, specify the method of searching asset trees, either by asset tree IDs or by asset tree tags. |
Tree ID |
No |
Specify asset tree ID. In the Output Point field, specify the measurement point for the generated data records, using the format {modelId}::{pointId} or {pointId}. |
Tree Tag |
No |
Specify asset tree tag and value. In the Output Point field, specify the measurement point for the generated data records, using the format {modelId}::{pointId} or {pointId}. |
Output Point |
Yes |
When the By ModelIDs method is selected, specify the measurement point for the generated data records, using the format {modelId}::{pointId}. |
Record Generate¶
The methods of generating records include: Query From Redis, Query From TSDB, Generate New Point, and Generate Trigger Point. The configuration for each method is as follows.
Query From Redis¶
Name |
Required? |
Description |
---|---|---|
Use LastUpdate Interval Filter |
No |
Select whether to get the latest asset data from Redis using a fixed time interval. |
LastUpdate Interval(Minutes) |
No |
Enter the time interval for getting the latest asset data. |
NotExistHandle |
Yes |
Select the processing method when no data is retrieved.
|
Query From TSDB¶
Name |
Required? |
Description |
---|---|---|
Start Time |
Yes |
Enter the start time to query the data from TSDB, using the format 2019-08-26T00:00:00+08:00. |
Time Interval |
Yes |
Enter the time range to query the data. |
End Time |
Yes |
Enter the end time to query the data from TSDB, using the format 2019-08-26T00:00:00+08:00. |
NotExistHandle |
Yes |
Select the processing method when no data is retrieved.
|
Generate New Point¶
Name |
Required? |
Description |
---|---|---|
Date Format |
Yes |
Select the date format of the generated data. Options are SimpleDateFormat and TimeFunctions.
|
Start Time |
Yes |
Enter the timestamp for the start time of the new point, using the format 2019-08-26T00:00:00+08:00. |
Time Interval |
Yes |
Specify the time interval for generating the new point data. |
Value Generator |
Yes |
Select the method of generating new point data and the data type.
|
Generate Trigger point¶
Name |
Required? |
Description |
---|---|---|
Date Format |
Yes |
Select the date format of the generated data. Options are SimpleDateFormat and TimeFunctions.
|
Start Time |
Yes |
Enter the start time of the generated data, using the format 2019-08-26T00:00:00+08:00, or enter the StreamSets expression for generating the timestamp. |
Time Interval |
Yes |
Specify the time interval for generating the new point data. |
Value Generator |
Yes |
Select the method of generating new point data and the data type.
|
Output Results¶
The output results of this stage are the generated records, which include the following:
Common fields (such as assetId, pointId, modelId, time, value)
Stage configuration attributes, which are included in the
/attr/recordGenerator
field, described in the table below.
Name |
Data Type |
Description |
---|---|---|
assetCfg |
String |
The selected method used to determine the dataset to be generated. |
generateBy |
String |
The selected method used to generate the records. |
queryStart/queryEnd |
String |
The specified start time and end time to query data from TSDB. |
offset |
Long |
The count of the generated data when the record is simulated. |
curQueryBatch |
Long |
The count of the record batches that triggers the generation of the simulated data. |
triggerPoint |
Boolean |
Whether the generated data records are triggering points. |
generatorKey |
String |
When generating triggering points, the value of Generate Type. |