Processor
Last updated
Last updated
In Cortex, when constructing Applications using Node Units, the Processor Node plays a critical role. Processor Node is required to determine the handling of outputs from input-processing Nodes like Query, Join, Pattern, and Sequence Nodes. It's a key requirement to connect these Nodes with a Processor Node.
Every Query, Join, Pattern, and Sequence Nodes should be connected with a Processor Node to determine output manipulations. (cf. Node Units)
This connection is essential for defining and executing the desired manipulations on the outputs of these processing Nodes, ensuring that the data flow and processing within your Application are coherent and aligned with your objectives.
When configuring a Processor Node in Cortex involves several key actions.
Assign a unique name to the Node, distinct from other Nodes in your Application.
Optionally, add a Description for detail and clarity.
The Node Name and Description will help distinguish it in the Canvas via Node Preview.
For the Processor Node in Cortex, the Attributes are automatically derived as inputs from Buffer Nodes connected to its left side.
Attributes in the Query Node automatically originate from Buffer Nodes to its left.
Attributes Table displays a list of Attributes Names, Input Node Names, and Attribute Types for each input attribute.
In Step 2 of the Processor Node, it's required to connect at least one output node and define its attributes to its right before proceeding.
You need to connect at least one output node to Processor to continue.
This output node may be a Sink or a Buffer Node (Stream, Table and/or Window).
You also need to define output nodes' attributes also.
In Processor Node's Step 2, it's crucial to connect to an at least one output node and define its attributes to proceed (either a Sink Node or a Buffer Node) to the Processor Node. Failure to establish this connection will result in an error message.
After you connect at least one output node; you will now decide on the "freshness" of events that will be sent to the output node. Event Type choice is where you define "freshness" that is defined via Window Expiry.
"Fresh" events are called Current Events that have not expired and are within the temporal or quantitative bound that a window constitutes.
Any input node that incorporates a window also accommodates some "expired" events as windows keep events based on a time/quantity condition (cf. Windows). As these expired events have already expired due to Window Expiry; they are considered "stale/not-fresh" compared to Current Events that have not expired yet.
Event Type is crucial for identifying which type of events will be relayed to the output node when an input node should send these events.
You should select an Event Type if you have a Window Node or have enabled windows in the Query Node.
Current Events
Only events that are actively within the input node window's defined criteria will be sent to the output node.
Expired Events
Only events that were once current but have now exceeded the window's criteria will be sent to the output node.
All Events
Both current and expired events at the window will be relayed to the output node.
After you decide on the Event Type for windows, you will now decide with Output Actions on the output node(s). This is where you determine the relay action to the output node.
Allowed output actions to the output node(s) depends on the type of the output node.
If only Insert action is allowed for the output node, you need not to make a decision.
Stream/Sink
Insert
Table
Insert, Update, Update or Insert (Upsert), Delete
Window
Insert
Lets the input attributes to be inserted into the output nodes with the logic that will be decided on following Steps.
Allows some or all output Table Node attributes to be updated.
Allows an output Table Node attributes to be updated based on an optional Update Condition.
Without an Update Condition, all events in the output Table Node will be updated.
Update Condition determines how events are selected for updating.
When using table attributes in the Update Condition, they must be referenced with the table name.
We strongly encourage that you utilize Connected Node Attributes top-most section of the Expression Builder in order to properly utilize output Table Node's attributes.
The Set Conditions allows selective updating of output Table Node attributes. Here, each assignment's left side specifies the attribute to update, while the right side can include various elements like query output attributes or mathematical operations. You can use Expression Builder to construct Set Conditions.
If any Set Conditions are not utilized for any output Table Node attribute, all output Table Node attributes are updated based on the Update Condition.
Allows all output Table Node attributes to be updated or inserted unless they exist based on an optional Update or Insert Condition.
Allows all output Table Node attributes to be updated or inserted based on an optional Update Condition.
Without an Update or Insert Condition, all events in the output Table Node will be updated.
Update or Insert Condition determines how events are selected for updating or insertion.
When using table attributes in the Update Condition, they must be referenced with the table name.
We strongly encourage that you utilize Connected Node Attributes top-most section of the Expression Builder in order to properly utilize output Table Node's attributes.
The Set Conditions allows updating or inserting of all output Table Node attributes. Here, each assignment's left side specifies the attribute to update, while the right side can include various elements like query output attributes or mathematical operations. You can use Expression Builder to construct Set Conditions.
Different from an Update operation; when utilizing Update or Insert you must Set Conditions for all output Table Node attributes.
Allows to delete output Table Node attributes based on a Delete Condition if specified.
Allows some output Table Node attributes to be deleted based on an optional Delete Condition.
BE CAREFUL: Without a Delete Condition, the table in the output Table Node will be deleted.
Delete Condition determines how events are selected for deletion.
When using table attributes in the Delete Condition, they must be referenced with the table name.
We strongly encourage that you utilize Connected Node Attributes top-most section of the Expression Builder in order to properly utilize output Table Node's attributes.
On Output Attributes section, you will create mappings between input and output nodes' attributes.
You may refer to the Expression Builder and Built-in Functions sections to see how you can embed processing logic to your output node attributes.
When dealing with multiple output nodes, the attributes are grouped based on their respective output Node Names. You are required to define expressions for each attribute across all output nodes, ensuring a precise mapping and functional alignment between inputs and outputs.
After you create mapping between input and output node attributes; you will now decide on the Aggregation Groups if you need any.
Any Input node that incorporates a window also clusters multiple events of every attribute based on a time/quantity condition (cf. Windows). Aggregation Groups lets you aggregate windowed events based on their attributes.
Aggregation Gorups becomes activated if you have a Window Node or have enabled windows in the Query Node.
In this Step, you can decide to put Output Filtering to filter outputs, Ordering to order output attributes in an ascending/descending order, and/or impose Limit and Offset to output node attributes.
You can select any combination of Output Relaying Logic elements to any of the output nodes connected to suit your requirements.
Output Filtering is used to filter events at the query output based on specified conditions applied to the output node attributes. This function is versatile, accepting various types of conditions, including combinations of output node attributes, constants, and built-in functions that yield a Boolean result.
When the Output Filtering evaluates to true, events are allowed to pass through; if it evaluates to false, the events are dropped. This feature is essential for refining the data that flows through the application based on specific criteria.
Ordering is used to sort output node attributes based on one or more specified attributes. It defaults to ordering the events in ascending order.
Any Input node that incorporates a window also clusters multiple events of every attribute based on a time/quantity condition (cf. Windows). Ordering lets you order windowed events in ascending or descending order.
Ordering output node attributes can be done by selecting either Ascending or Descending order.
This function is crucial for organizing query results in a structured manner, according to your specified criteria.
BE CAREFUL: There exists an order of precedence in each Ordering for the output node attributes. The first Ordering takes precedence before the second, the second ordering before the third, and so on.
Limiat and Offset lets you select a limited number of output events as output to be relayed to tne output node.
Any Input node that incorporates a window also clusters multiple events of every attribute based on a time/quantity condition (cf. Windows). Limit and Offset lets you limit the number of output events and
Limit allows you to specify the maximum number of events to relay to the output node.
Offset determines the starting point in the event sequence.
You can only impose a Limit condition. You need not to set a complementing Offset condition to every Limit condition.
e.g. For a Limit = 3 and Offset = 8 condition; only 9th, 10th, an 11th events will be relayed to the output node.
e.g. For a sole Limit = 10 condition, only 10 events will be relayed to the output node.
This feature is useful for managing and manipulating data chunks produced by queries, enabling more controlled and specific data processing and analysis.
In this Step, you can decide to put Output Rate Limiting to control the frequency of events to be relayed to the output node. This limitation can be based on time or a specified number of events. The mechanism for selecting which output events are sent from the query is determined by the
You can select only one type of Rate Limiting for each connected output node.
BE CAREFUL: Output Rate Limiting essentially defines how the events will be sent together to the output node.
Three different types of Output Rate Limiting are directly correlated with the Output Event Selection. Before delving into details of Output Event Selection, we first present you the three types of Output Rate Limiting.
Time Based
Outputs events together according to the Output Event Selection within every Time Interval.
Event Based
Outputs events together according to the Output Event Selection for every Event Count.
Snapshot Based
Outputs all events together already windowed for every given Time Interval.
Output Event Selection determines which events events will be sent together to the output nodes.
First
Outputs together the very first event(s) in the specified Time Interval or Event Count is emitted.
Last
Outputs together only last event(s) in the specified Time Interval or Event Count is emitted.
All
Outputs together all events within the Time Interval or Event Count.
Time Based Output Rate Limiting requires a Time Interval and relays events to the output node.
First
Outputs only the very first event in the specified Time Interval.
Last
Outputs only the last event in the specified Time Interval.
All
Outputs together all events within the Time Interval.
Count Based Based Output Rate Limiting requires an Event Count and relays that many events to the output node.
First
Outputs together the very first events as many as the Event Count. (Iff Event Count is bigger than 1)
Last
Outputs together only the last events as many as the Event Count. (Iff Event Count is bigger than 1)
All
Outputs together all events as many as the Event Count.
(Iff Event Count is bigger than 1)
Snapshot Based Output Rate Limiting requires a Time Interval and can be applied to attributes from an input node that incorporates a window. Any input node that incorporates a window also clusters multiple events of every attribute based on a time/quantity condition (cf. Windows).
First
Outputs only the already-windowed very first event in the specified Time Interval
Last
Outputs only the already-windowed last event in the specified Time Interval.
All
Outputs together all already-windowed events within the Time Interval.
In Preview Step, you're provided with a concise summary of all the changes you've made to the Processor Node. This step is pivotal for reviewing and ensuring that your configurations are as intended before completing node setup.
Viewing Configurations: Preview Step presents a consolidated view of your node setup.
Saving and Exiting: Use the Complete button to save your changes and exit the node and return back to Canvas.
Revisions: Use the Back button to return to any Step of modify node setup.
The Preview Step offers a user-friendly summary to manage and finalize node settings in Cortex.