...
Snap type:
...
Read
...
Description:
...
In this article
Table of Contents |
---|
Overview
You can use this Snap to force a Pipeline to stop with a failed status if it receives more records than the user-defined threshold.
...
Snap Type
The Exit Snap is a Read-type Snap.
Prerequisites
...
...
[None]
...
- Ultra pipelines: May work in Ultra Pipelines.
- Spark mode: Not supported in Spark mode.
...
Accounts are not used with this Snap.
...
None.
Limitations and Known Issues
None.
Support for Ultra Pipelines
Works in Ultra Tasks.
Info | ||
---|---|---|
| ||
When an input document is passed to the Exit snap in an Ultra pipeline, the Snap acknowledges the message (removes it from the request queue) and fails the Pipeline (depending on the Threshold limit). |
Snap Views
Type | Format | Number of Views | Examples of Upstream and Downstream Snaps |
---|---|---|---|
Input | Document |
| N/A |
Output | Document |
| N/A |
Error | No error view is defined for this Snap. Nothing is written to the error view in this Snap. The Snap |
...
fails the |
...
Pipeline if it receives more than the required number of records |
...
. |
...
Settings
...
Label
...
Snap Settings
Field | Field Type | Description | |
---|---|---|---|
Label*
| String | Specify the name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your |
...
Pipeline. | |
Threshold limit |
...
...
*
| Integer/Expression | Specify the maximum number of input records to be received by the Snap. |
...
|
...
|
...
|
...
|
...
Exit error message
|
...
Value: |
...
|
...
Exit error message
...
Exceeded threshold limit | String/Expression | Specify the message to be displayed when the error occurs.
|
...
|
...
|
...
|
...
Default value: Exceeded threshold limit
...
| |||
Snap Execution
| Dropdown list | Select one of the three modes in which the Snap executes. Available options are:
|
Examples
Write up to Three Input Documents into SLDB and Reject All Additional Documents
In this example, you have a list of documents, and you want to filter the first six input documents based on the number they contain in a specific field. You want all odd numbers routed into one branch, and all the even numbers, into another. To do so, you create a parent and child Pipeline.
- The parent Pipeline accepts multiple documents and triggers the child Pipeline for each document.
- The child Pipeline routes incoming documents into two branches based on their contents. It then accepts only the first three documents in each branch and generates an error for each additional document.
The Child Pipeline
You first design the child Pipeline.
- Add a Router Snap to the Pipeline and configure it to route all documents containing even numbers in the
$num
field into a branch labeled Even, and all documents containing odd numbers into a branch labeled Odd. - Add an Exit Snap to each output view of the Router Snap and configure them both to pass three documents and throw an error when they receive more than three documents. Also, add an output view to each Exit Snap, so you can view the documents that were passed.
- Add a JSON Formatter Snap to the output view of each Exit Snap to convert the Exit Snap's output documents into a binary stream of data.
- Add a File Writer Snap to the output view of each JSON Formatter Snap and configure each to write out the data received as JSON files in SLDB.
The Parent Pipeline
Design the parent Pipeline to accept multiple documents and trigger one child Pipeline execution for all the input documents, together.
- Add a JSON Generator Snap to the Pipeline and configure it send seven documents, in three of which the
$num
field contains even numbers. In the four remaining documents,$num
contains odd numbers. - Add a Pipeline Execute Snap to the Pipeline and configure it to execute the child Pipeline once for the entire collection of documents received from the JSON Generator Snap. To do so, select the Reuse executions to process documents check box. If you do not select this check box, then the child Pipeline will be executed once for each document coming in, and the Exit Snap will always receive only one document and never throw an error. For details on configuring the Pipeline Execute Snap, see Pipeline Execute.
- Save and execute the parent Pipeline.
- The Pipeline Execute Snap sends all seven documents together to the child Pipeline for processing.
- The Router Snap routes the incoming documents into two branches, Even and Odd.
- The Exit Snap attached to the Even branch offers all three documents as output and does not throw any error.
- The Exit Snap attached to the Odd branch offers all three documents as output. It also sends an error back to the Pipeline Execute Snap, which triggered the child Pipeline.
- The two File Writer Snaps create two documents, Evens.JSON and Odds.JSON, in SLDB, each containing three documents.
Downloads
Multiexcerpt include macro | ||||
---|---|---|---|---|
|
Attachments | ||
---|---|---|
|
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|