Deploying and Managing Apama Applications > Event Correlator Utilities Reference > Using the data player command-line interface
Using the data player command-line interface
Apama Studio’s Data Player lets you play back previously saved event data as you develop your application. During playback, you can analyze the behavior of your application. Or, if you modify the saved event data, you can analyze how your application performs with the altered data. Apama Studio plays back event data that has been stored in standard data formats.
When you are ready to test your application the command-line interface to the Data Player lets you write scripts and unit tests to exercise the API layers. Or, if you just want to play back events to the correlator, using the command-line interface might be easier than using the Data Player GUI in Apama Studio.
To use the command-line interface to the Data Player, you must have already used the GUI interface in Apama Studio. That is, you must have already defined queries and query configurations in Apama Studio. When you use the command-line interface, you specify query names and query configurations that you created in Apama Studio.
The Data Player relies on Apama Database Connector (ADBC) adapters that are specific to standard ODBC and JDBC database formats as well as the comma-delimited Apama Sim format. Apama release 4.1 and earlier captured streaming data to files in the Sim format. These adapters run in the Apama Integration Application Framework (IAF), which connects the data sources to the correlator. The information here assumes that you are already familiar with the information in Using the Data Player in Using Apama Studio.
Synopsis
To use the Data Player from the command line, enter adbc_management.bat (Windows) or adbc_management (UNIX) from the bin directory in your APAMA_HOME directory:
To obtain the following usage message, run the command with the help option:
Usage:
adbc_management --query <queryName> --configFile <file> [ options ]
Where options include:
-h | --help                This message
-n | --hostname <host>     Connect to correlator on <host>.
                           Default to localhost.
-p | --port <port>         Connect to correlator on <port>.
                           Default to 15903.
--query <queryName>        Run the query <queryName> specified in
                           query configuration file.
--configFile <file>        Query configuration file to use.
--username <user>          Optional username for database connection.
--password <password>      Optional password for database connection.
--returnType <returnType>  Optional returnType of playback events.
                           Default is native.
--backTest <true|false>    Optional switch to generate time event from
                           data.
                           Use false if correlator is not running
                           -Xclock option. Default is true.
--speed <playBackSpeed>    Optional speed for playing back query.
                            <= 0.0, as fast as possible
                            > 0.0 for some multiple of playback speed.
                            (Ignored if --backTest false is used.)
Options
Option
Description
-h
Display usage information
-n
Name of the host on which the event correlator is running (default is localhost). Non-ASCII characters are not allowed in host names.
-p
Port on which the event correlator is listening (default is 15903).
--query queryName
Run the specified query, which is defined in the query configuration file that you identify with the --configFile option. This is a query you created in Apama Studio in the Data Player Editor. You did this when you clicked on the + button on the action bar. You specified a query name and that is the name you need to specify here
--configFile file
Use this query configuration file. Specify the query configuration file associated with your project. In Apama Studio, the query configuration file is always called dataplayer_queries.xml (in the project/config directory).
--username user
The user name to use for the database connection. Optional.
--password password
The password to use for the database connection. Optional.
--returnType returnType
The type of the playback events returned. The default is Native. The only other choice is Wrapped. A return type of Native means that each matching event is sent as-is to the correlator. When you specify Wrapped, each matching event is inside a container event. The name of the container event is Wrapped followed by the name of the event in the container, for example, HistoricalTick. Event wrapping allows events to be sent to the correlator without triggering application listeners. A separate, user-defined monitor can listen for wrapped events, modify the contained event, and reroute it such that application listeners can match on it.
--backTest <true|false>
This option is equivalent to Apama Studio’s Data Player option to "Generate time event from data". When the correlator is running with the -Xclock option, time in the correlator is controlled by &TIME() events. This is how the Data Player controls the playback speed. If the correlator is not running with the -Xclock option, the correlator keeps its own time. The default is true, which means that the correlator is running with the -Xclock option. Set this option to false when the correlator is not running with the -Xclock option.
--speed playBackSpeed
Specifies the speed for playing back the query. Optional. A float value less than or equal to 0.0 means that you want the correlator to play it back as fast as possible. A float value greater than 0.0 indicates a multiple for the playback speed. To play at normal speed, specify 1.0.For half normal speed, specify 0.5.For twice normal speed, specify 2.0.For 100 times normal speed, specify 100.00.
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.