Pipeline Finisher Executor
When it receives an event, the Pipeline Finisher executor stops a pipeline and transitions it to a Finished state. This allows the pipeline to complete all expected processing before stopping.
Use the Pipeline Finisher as part of an event stream. You can use the Pipeline Finisher in any logical way, such as stopping a pipeline upon receiving a no-more-data event from the JDBC Query Consumer origin.
For example, you might use the executor in a pipeline designed to migrate all existing data from Microsoft SQL Server to HDFS. And then use a separate pipeline to process incremental updates. Or, you might use the executor to perform traditional "batch" processing - to process data, then stop when all data is processed rather than waiting indefinitely for more data.
When you restart a pipeline that was stopped by the Pipeline Finisher, the restart behavior depends on the origin. For example, if the origin stores an offset, when you restart the pipeline the origin begins at the last-saved offset by default. That is, if you run JDBC Query Consumer in incremental mode, the pipeline continues where it left off when you restart the pipeline. However, if you configure the JDBC Query Consumer to perform a full query, when you restart the pipeline, the origin performs the full query again. For more information, see "Event Generation" in the origin documentation.
The Pipeline Finisher executor has no stage-specific properties, but you might use a precondition to limit the records that enter the stage. You might also set up notification to be informed when the Pipeline Finisher stops the pipeline.
Before using the Pipeline Finisher, review the recommended implementation information.
For a case study about using the Pipeline Finisher, see Case Study: Stop the Pipeline. For more information about dataflow triggers and the event framework, see Dataflow Triggers Overview.
Recommended Implementation
The Pipeline Finisher executor is designed to stop and transition a pipeline to a Finished state after processing available data in the origin system. For example, you might use the executor to stop the pipeline after the JDBC Query Consumer processes all available data specified in the query.
When an origin generates only the no-more-data event, you can simply connect the event output to the Pipeline Finisher executor. When an origin generates multiple event types, you need to ensure that the Pipeline Finisher stops the pipeline only after receiving the no-more-data event.
- Configure a precondition for the Pipeline Finisher
- In the executor, add a precondition to allow only a no-more-data event into
the stage to trigger the executor. You can use the following
expression:
${record:eventType() == 'no-more-data'} - Add a Stream Selector before the Pipeline Finisher
- You can add a Stream Selector between the origin and the executor to route only the no-more-data event to the Pipeline Finisher. Use this option when you want to pass other event types to a different branch for processing.
Related Event Generating Stages
Best practice is to use the Pipeline Finisher only with origins that generate no-more-data events.
- Amazon S3 origin
- Directory origin
- Google Cloud Storage origin
- Hadoop FS Standalone origin
- JDBC Multitable Consumer origin
- JDBC Query Consumer origin
- MongoDB origin
- Salesforce origin
- SFTP/FTP Client origin
- SQL Server CDC Client origin
- SQL Server Change Tracking origin
Notification Options
- Pipeline state notification
- You can configure the pipeline to send an email or webhook when the pipeline transitions to the specified state. Use this option to send a webhook or a simple email notification. You cannot customize the email notification that is sent.
- Email executor
- You can use an Email executor to send email notification. The Email executor allows you to configure the condition to use to send the email, email recipients, subject, and message. You can also use expressions in any property to include details from the event record in the email. Use this option to send a customized email upon receiving an event.
Configuring a Pipeline Finisher Executor
- In the Properties panel, on the General tab, configure the
following properties: