<< Click to Display Table of Contents >> Navigation: Technical Guide > Streams |
DTS Streams are constructs that allow the transfer of data objects or records from available resources iteratively or in batches. They differ from record sets in that a stream does not contain any data records. Instead it is a token that permits requesting record sets and automatically advances as they are delivered. They are very much equivalent to Database Result Sets or File Output Streams in scope and operation. Indeed, a DTS Stream may actually use one or more Result Set(s) or Output Stream(s) to source the data objects it provides. Its purpose is to wrap such data source constructs in a form that is friendly to remote interaction.
DTS provides streaming access to the following types of resources:
Collections / Tables / Views |
Data from any storage construct accessible through DTS connectors can be streamed. |
Stream Result Routines |
Certain routines are considered to provide results in the form of Streams e.g.: Table-Valued Functions, methods returning DTS record streams, etc. |
Aggregates |
DTS Aggregates can be streamed from as if they were a simple collection. |
Topics |
Upon subscription to a Topic, a DTS is created. Polling the topic can only be done using this stream. |
DTS Streams have a simple lifecycle, defined by the available operations:
Create |
Open |
Open a stream to a storage or aggregate resource. Can optionally use a DTSPredicate to perform a specific query. If no predicate is provided, the entire resource will be streamed (subject to any static filters put in place). |
ExecuteStreamCall |
Execute a Routine whose result is a stream. |
|
Subscribe |
Subscribe to a Topic to consume it via a stream. |
|
Regardless of how a Stream is created, the result is an Active Stream, represented by a Stream ID (in UUID format).
|
||
Active |
GetRecords |
Requests a batch of records on the stream. Must provide a size for the batch. If enough records remain, then that number of records is returned, otherwise as many as are left. |
HasMore |
Queries whether there are more records on the stream. |
|
Poll |
Similar to GetRecords but wrapped for Topic use -> it does not take a specific size. |
|
While a Stream is active, it takes up a slot in the Active Streams of the DTS Product Licence.
|
||
Close |
Close |
Closes the stream, and frees associated resources. |
Active Streams that have had no operation performed on them for 2 minutes will time out and close automatically. |
DTS Streams always adhere to the above specification, but the way they are effectively accessed depends on the Client API or Implementation.
Currently, the following are available: