Compiling stream applications

The Streams Processing Language (SPL) Compiler is called sc and is included with the Teracloud® Streams installation package. You compile SPL to create files to run on your Teracloud® Streams instance.

A stream application corresponds to a main composite in an SPL toolkit. A composite operator that is defined in an .spl file is called a potential main composite if and only if it does not have any input or output ports and mandatory parameters. A stream application has one such potential main composite that is designated as its main composite. To compile a stream application, its main composite name must be passed to the sc command.

In order for the sc command to generate an application bundle file, it needs to have access to the toolkit that contains the application's designated main composite, and other toolkits that are listed as dependencies of this toolkit. An application gets its version and dependency information from the toolkit that defines its main composite.

The result of compiling a main composite is a set of artifacts that includes an application bundle file. This application bundle file is a file format that is specific to Teracloud® Streams and contains all the necessary application artifacts to run in a Teracloud® Streams instance.

When the application bundle file is submitted to a Teracloud® Streams instance, it creates a job and determines how your application is divided into processing elements (PEs) based on the compile-time, submission-time information and the runtime resources available. PEs load the application libraries from the bundle file and serve as an execution container for one or more operator instances.