Database Reference
In-Depth Information
FileSource and FileSink
As the names imply,
FileSource
and
FileSink
are standard built-in
adapters that are used to read from or write to a file. You use parameters to
specify the name and location of the file that is to be used for the read or
write operation. Another parameter identifies the format of the file's con-
tents, which could be any of the following formats:
•
txt
Simple text files, where each tuple is a row in the file
•
csv
Files that contain comma-separated values
•
bin
Files that contain binary data tuples
•
line
Files that contain lines of text data
•
block
An input stream made up of binary data blocks (much like a
BLOB)
There are a number of other optional parameters that can be used to specify
column separators, end-of-line markers, delimiters, compression, and more.
TCPSource/UDPSource and TCPSink/UDPSink
The
TCPSource
and
TCPSink
adapters are the basic TCP adapters used in
Streams to read from and write to a socket. When you use these adapters,
you specify the IP address (using either IPv4 or IPv6) along with the port,
and the adapter will read from the socket and generate tuples into the stream.
Parameters for these adapters are the same as those for the
FileSource
and
FileSink
adapters, in terms of the format of the data flow (
txt
,
csv
, and
so on). The
UDPSource
and
UDPSink
adapters read from and write to a
UDP socket in the same manner as the TCP-based adapters.
Export and Import
The
export
and
import
adapters work together to connect jobs within a
Streams instance. An
export
adapter can be used to make data from a job
available to other jobs that are already deployed or that might be deployed in
the future. You can export data using the
export
adapter and assign a
streamID
to the exported stream, as well as optional name/value pairs to
further characterize the stream.
After the stream is assigned these export properties, any other Streams
applications that are deployed to the same Streams instance can import this