uCosminexus Stream Data Platform - Application Framework Setup and Operation Guide
![[Contents]](FIGURE/CONTENT.GIF)
![[Index]](FIGURE/INDEX.GIF)
![[Back]](FIGURE/FRONT.GIF)
If you want to reproduce a problem event that has occurred, or re-check summary analysis results, you re-execute queries by reloading the data for a specific time period.
To re-execute queries, you use the sdptplput command. For the target data to be re-processed, use information about the input tuples collected in the tuple log file. When you execute the command, tuples are reloaded to the input stream queues from the tuple information collected in the tuple log file. After reloading of tuples is completed, the putEnd method is executed on all input stream queues, and the query group is initialized.
You can check the result of query re-execution by using the sdptplls command to display the tuple information collected from the output stream queue to the tuple log.
The following figure shows the flow of data when queries are re-executed to check execution results.
Figure 4-2 Flow of data during query re-execution
![[Figure]](FIGURE/ZS040200.GIF)
- Execute the sdptplput command (with tuple log A specified) to reload tuples.
- Re-execute the query on the loaded tuples.
- Execute the sdptplls command (with tuple log B specified) to check the tuple information.
The following subsections discuss the permitted range of query re-execution, query re-execution procedure, and notes about re-executing queries.
- Organization of this subsection
- (1) Permitted range of query re-execution
- (2) How to re-execute queries
- (3) Notes about re-executing queries
The permitted range of query re-execution differs between the server mode and the data source mode. The permitted range is as follows:
- In the server mode
Query execution
- In the data source mode
From timestamp adjustment to query execution
For details about the timestamp adjustment function, see 10.8 Timestamp adjustment for tuples.
You use a tuple log file that has been acquired to re-execute a query. A query can be re-executed in an environment that is different from the environment used to acquire the tuple logs, except that the default character encoding must be the same in both environments.
This example assumes that the environment in which queries are re-executed is different from the environment where tuple logs were acquired.
To re-execute queries:
- Copy the required files to the environment where queries are to be re-executed.
Copy the query definition files for the query group to be re-executed, query group property file, and tuple log file from the environment where tuples were acquired to the environment where the queries are to be re-executed.
- Specify the settings required for acquiring tuple logs.
Specify BUFFER in the tpl.outputTrigger parameter in the query group property file to acquire tuple logs from the output stream queue. If you use a tuple log file acquired in the server mode, specify true in the stream.tupleLogMode parameter.
- Register the query group to be re-executed.
Use the sdpcql command to register the query group to be re-executed.
- Start the query group to be re-executed.
Use the sdpcqlstart command to start the query group to be re-executed.
- Re-execute the queries.
Use the sdptplput command to reload tuples from the tuple log file and then re-execute the queries.
- Check the results.
Use the sdptplls command to display the contents of the tuple log file in the output stream queue and check the results.
For details about the sdpcql, sdpcqlstart, sdptplput, and sdptplls commands, see sdpcql (registers a query group), sdpcqlstart (starts a query group), sdptplput (reloads tuples), and sdptplls (displays tuple information) in 7. Commands.
(3) Notes about re-executing queries
- If you re-execute queries by loading tuples starting with any tuple other than the first tuple loaded by an adaptor, the results might differ from those obtained when the queries were executed using the adaptor.
- Because the sdptplput command does not reproduce the tuple loading interval, the input stream queue might result in an overflow. If overflow occurs, the operation depends on whether the server mode or the data source mode is used:
- In the server mode
A tuple whose reload failed is reloaded at the interval specified in the -interval option. In this case, the KFSP42005-E and KFSP52003-E messages are displayed, but they have no effect on query re-execution.
- In data source mode
If queue overflow occurs, the query group is shut down, resulting in a query re-execution error. Therefore, use the -interval and -count options to adjust the interval at which tuples are reloaded and the number of tuples to be reloaded.
- Do not start adaptors while the sdptplput command is executing. If adaptors are started at such a time, the following occurs:
- When input adaptors are started
The reloaded tuples are intermixed with the tuple loaded by the input adaptors, thereby causing the results obtained from query re-execution to be different from the results obtained when queries were executed by using the input adaptors.
- When output adaptors are started
Overflow might occur in the output stream queue, resulting in shutdown of the query group.
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.