Introduction to Infosphere Streams 2.0 features: Using collections
Source: Internet
Author: User
KeywordsInfospherestreams Introduction to Features
You will also learn how to access the collection using the underlying c++++ Streams operator.
This article describes the 3 collection types currently available for Infosphere Streams 2.0 http://www.aliyun.com/zixun/aggregation/7155.html > developers. Set and mapped composite types are not only available for Streams version 2.0, but also provide flexibility for nesting of underlying and composite types. This article demonstrates the powerful features of the new type using both the Streams processing language and some examples of C + +.
Prerequisites
This article is written for Streams component developers and application programmers who have Streams programming language skills and C + + skills. You can use this article as a reference, or you can examine and run an example to demonstrate the technology described. To perform the sample, you should have a general understanding of Streams programming.
Running these samples requires a computer running Red Hat Enterprise linux® with Infosphere Streams V2.0 or later installed.
Understanding Collections
Streams Processing Language (SPL) supports both the underlying type (int and string, and so on), and also supports composite types (sets and mappings) that can be used to represent streaming data in an SPL application. A set of compound types, called collections, can be used to represent a complex arrangement of stream data, and support the use of the built-in SPL function to access and manipulate the contents of the collection.
In earlier versions of Infosphere Streams, the spade language supported a set of restricted composite types, including matrices and lists, that could be used to manage the underlying type groupings. Streams 2.0 gave up the matrix type. The list of supported collections now contains:
set (new in Release 2.0) map (New in version 2.0) List
The collection has been further expanded to represent complex nesting of compound types, including lists of lists, which adds flexibility to the data managed by the collection.
Figure 1. Streams Foundation and composite types
Restricted and unrestricted types
For basic types such as strings, SPL also implements a collection type with a finite length. The size of any finite length collection needs to be defined using a compile-time constant. You can also declare a finite set of infinite types, such as a finite list of rstring. From a developer's perspective, the difference between finite and infinite types is small. However, there are some compile-time optimization advantages when using finite types.
Note that SQL restricts any collection to up to 231-1 elements, whether restricted or unrestricted.
The following sections describe the composite type in more detail.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.