Stand-alone option for the compiler
You can compile applications as stand-alone applications by using the -T, --standalone-application command.
The sc compiler can be instructed to generate and compile stand-alone applications. A stand-alone application is a binary that can be launched directly, that is, it does not run on the Streams instance. The compiler option for requesting stand-alone applications is -T, --standalone-application. In the stand-alone mode, all operators are fused into a single partition and a single PE is generated for this partition. An application bundle file is generated along with a stand-alone executable file with the name standalone in the output/bin directory.
If your main composite operator is named Main, you can launch a stand-alone application in one of the following ways.
- Run output/bin/standalone.
- Run output/bin/Main.
- Run java -jar output/Main.sab. The Main.sab file can be run from any directory with the java -jar command.
- Run output/Main.sab. This method requires your system to be configured so that JAR files are executable with the prerequisite level of Java™.
When launched, this executable file loads the PE. The same PE is also runnable on the Streams instance. However, there are a few restrictions in the stand-alone mode:
- All operators are fused into a single PE.
- The logging output goes to the standard output or standard error, depending on the launch options specified.
- Imported and exported streams and associated functions do not work, such as subscription expressions and export properties.
- Host pool information and host placement constraints are ignored.
- The @view annotation is ignored.
- There is no support for runtime interaction with InfoSphere® Streams tools, such as the Streams Instance Graph view or the Streams Console.
Stand-alone applications end when no thread of execution is left for doing work for the operators that are contained within the single PE. Care needs to be taken for threads that are not managed by a Streams instance. Ensure that the primitive operators contain the necessary logic for joining such threads, as otherwise the Streams instance might end the application prematurely.