Testing the application

Test the stream application to verify that the code generated from the graph is correct. You must build (compile) the application before you can run it. You can run the application in stand-alone mode or in a distributed environment..

Building the application

  1. Prepare the application workspace:
    1. Create a new directory called MyFilterApp.
    2. Enter the MyFilterApp directory.
  2. Create the input source file:
    1. Create a new directory called data.
    2. Inside the data directory, create a new file called StockTrades.csv.
    3. Copy and paste the sample data into the file, then save and close the file.
  3. Create the SPL source file:.
    1. Create a new file called MyFilterApp.spl.
    2. Copy and paste the SPL code into the file, then save and close the file.
  4. Compile the application by running the following command:
    sc --data-directory data -M MyFilterApp

Running your application in stand-alone mode

To test the application in stand-alone mode (i.e. running it locally on the system you built it on), run it as follows:

./output/bin/standalone
Result: The output from the MyFilterApp build is displayed in the console.

Running your application in a distributed environment

To test the application in a distributed environment (i.e. a running Streams instance), submit a job to a running Streams instance with the following command:

streamtool submitjob output/MyFilterApp.sab
Result: The output from the MyFilterApp job is sent to the PE console log. You can view the PE console log in Streams Console or by running the streamtool viewlog --pe <peId> --console command.