You must terminate the query groups registered in the SDP server. Note that termination of adaptors must be completed before you terminate query groups.
Perform this procedure when you terminate a query group that is run only for a set period of time each day or when you need to perform maintenance on a query group that normally runs continuously. When a query group has been terminated, send data from adaptors is no longer accepted.
There are two ways to terminate query groups:
This subsection provides the details of normal termination and forced termination and discusses relation discarding during query group termination.
When you terminate a query group during daily operation, you use the normal termination method. When you execute normal termination, the query group is terminated after the tuple processing currently in the input stream queue has been completed.
To terminate query groups normally, execute the sdpcqlstop command. An example of command execution is shown below. In this example, QueryGroupSample is the query group property file.
working-directory\bin\sdpcqlstop QueryGroupSample |
For details about the sdpcqlstop command, see sdpcqlstop (terminates a query group) in 7. Commands.
If a problem occurs while a query group is executing, you use the forced termination method to terminate the query group immediately. When you execute forced termination, tuples currently in the input stream queue are discarded and the query group is terminated immediately.
To terminate query groups forcibly, execute the sdpcqlstop command with the -force option specified. An example of command execution is shown below. In this example, QueryGroupSample is the query group property file.
working-directory\bin\sdpcqlstop -force QueryGroupSample |
For details about the sdpcqlstop command, see sdpcqlstop (terminates a query group) in 7. Commands.
A relation is a set of tuples retrieved by a window operation. Such a set of tuples becomes the target of data manipulation operations. A window operation refers to an operation that specifies a range subject to summary analysis; CQL is used to define such an operation. For details about the window operations that can be defined with CQL, see the manual uCosminexus Stream Data Platform - Application Framework Application Development Guide.
When a query group is terminated, any remaining input relation is discarded. The next time a query group is started, a new input relation starts without inheriting the previous input relation.
The following figure shows the status of an input relation when a query group is terminated.
Figure 4-3 Status of input relation when a query group is terminated
This figure shows the status of an input relation when the query group is terminated with [ROWS 3] specified for the window operation. [ROWS 3] means that there are three tuples in existence at the same time in the input relation. The abscissa indicates the time axis. The time progresses from left to right. t1 through t5 indicate the arrival times of tuples. The format of each tuple is company-name, price-increase-factor.
When this query group is terminated, the input relation containing CompanyA,0.8, CompanyB,1.1, and CompanyA,1.0 is discarded. The tuple CompanyA,1.2 that arrived at t5, which is after the query group was started, is then created and a new input relation begins.