10.8.2 Range of times to be adjusted

The timestamp adjustment function adjusts the time in those tuples whose time value is within a range of times to be adjusted. The range of times to be adjusted is determined by a reference time and a length of time to be adjusted. The period from the reference time to the point in time that is earlier than the reference time by the length of time to be adjusted constitutes the range of times to be adjusted by the timestamp adjustment function. This means that if the reference time changes, the range of times to be adjusted also changes.

Reference time
This is the base time used to adjust the time in tuples. The most recent time information in the tuples that have been sent to the input stream by the input adaptor after a query group started becomes the reference time for that input stream. When a tuple containing a more recent time arrives, the reference time changes to that time.
Length of time to be adjusted
This is the period of time to be adjusted. It is determined by the unit of time and the time adjustment range. For the unit of time, you can choose sec (seconds), msec (milliseconds), or usec (microseconds). The time adjustment range is a period of time in the selected units.
You specify the unit of time and the time adjustment range in the stream.timestampAccuracy parameter of the system configuration property file, query group property file, or stream property file. For details about the stream.timestampAccuracy parameter, see 8.6 System configuration property file (system_config.properties).

The following figure shows an example in which the range of times to be adjusted changes. In this example, sec is specified as the unit of time and 2 is specified as the time adjustment range.

Figure 10-26 Example in which the range of times to be adjusted changes

[Figure]

In this example, the reference time is set to 09:00:01, which is the time set in the tuple that has the most recent time information among the tuples that have arrived at the SDP server. The range of times to be adjusted is from 09:00:01 to 08:59:59, because the length of time to be adjusted is 2 seconds.

Then, a new tuple is sent from the input adaptor, and its time information is 09:00:02, which becomes the most recent time. Therefore, the reference time changes. As a result, the range of times to be adjusted changes to 09:00:02 to 09:00:00.