IBM InfoSphere Streams Version 4.1.1

Developing and running applications that use the Data Explorer Toolkit

SPL standard and specialized toolkits > com.ibm.streams.dataexplorer 2.0.0 > Developing and running applications that use the Data Explorer Toolkit

To create applications that use the Data Explorer Toolkit, you must set environment variables, ensure that InfoSphere Data Explorer JAR files are accessible to a streams processing application, and configure either IBM InfoSphere Streams or the SPL compiler to be aware of the location of the toolkit.

Before you begin

  • Install IBM InfoSphere Streams.
  • Set the STREAMS_INSTALL environment variable to the InfoSphere Streams installation directory. For example:
      source product-installation-root-directory/4.0.0.0/bin/streamsprofile.sh
  • Copy the following JAR files based on the InfoSphere Data Explorer version that you want to connect to:
    • InfoSphere Data Explorer v8.2-2 or v8.2-3:
      • Copy the BigIndex API and its dependencies to a location that is accessible to InfoSphere Streams. To obtain the BigIndex API and its dependencies, copy the install-dir/AppBuilder/bigindex.zip folder from the computer where IBM InfoSphere Data Explorer is installed. Extract the contents of the bigindex.zip folder to a location that is accessible to InfoSphere Streams.
    • InfoSphere Data Explorer v9.0-0:
      • Copy the BigIndex API and its dependencies to a location that is accessible to InfoSphere Streams. To obtain the BigIndex API and its dependencies, copy the install-dir/BigIndex/bigindex.zip folder from the computer where IBM InfoSphere Data Explorer is installed. Extract the contents of the bigindex.zip folder to a location that is accessible to InfoSphere Streams.

About this task

After the location of the toolkit is communicated to the compiler, the SPL artifacts that are specified in the toolkit can be used by an application. The application can include a use directive to bring the necessary namespaces into scope. Alternatively, you can fully qualify the operators that are provided by toolkit with their namespaces as prefixes.

Procedure

  1. Set the following environment variables based on the InfoSphere Data Explorer version that you want to connect to:
    • InfoSphere Data Explorer v8.2-2, v8.2-3, or v9.0-0:
      • Set the BIGSEARCH_JAR environment variable to the location of the JAR file for the BigIndex API.
  2. Configure the SPL compiler to find the toolkit root directory. Use one of the following methods:
    • Set the STREAMS_SPLPATH environment variable to the root directory of a toolkit or multiple toolkits (with : as a separator). For example:
      export STREAMS_SPLPATH=$STREAMS_INSTALL/toolkits/com.ibm.streams.dataexplorer
    • Specify the -t or --spl-path command parameter when you run the sc command. For example:
      sc -t $STREAMS_INSTALL/toolkits/com.ibm.streams.dataexplorer -M MyMain
      where MyMain is the name of the SPL main composite. Note: These command parameters override the STREAMS_SPLPATH environment variable.
    • Add the toolkit location in InfoSphere Streams Studio.
  3. Develop your application. To avoid the need to fully qualify the operators, add a use directive in your application.
    • For example, you can add the following clause in your SPL source file:
      use com.ibm.streams.bigdata.dataexplorer::*;
      You can also specify a use clause for individual operators by replacing the asterisk (*) with the operator name. For example:
      use com.ibm.streams.bigdata.dataexplorer::DataExplorerPush;
  4. Build your application. You can use the sc command or Streams Studio.
  5. Start the InfoSphere Streams instance.
  6. Run the application. You can submit the application as a job by using the streamtool submitjob command or by using Streams Studio.