testStream
Create connection to event stream hosted by MATLAB with schema processing applied
Since R2022b
This object requires Streaming Data Framework for MATLAB® Production Server™.
Description
The testStream
function creates a
TestStream
object, which you can use to test reading from and writing to
event streams hosted by MATLAB. TestStream
objects store events in MATLAB variables, which are exported to event streams based on the data type values
specified by the ExportOptions
property. TestStream
applies the standard configurable schema processing when reading and writing timetable data.
Use this object to test your schema management before deployment, without requiring a
streaming service host. The data in a TestStream
object disappears when you
exit MATLAB.
Use TestStream
to develop your streaming analytic function without having
to connect to or consume resources from a streaming service such as Kafka®. TestStream
stores data using MATLAB memory space, so use this object with finite-size data sets. Because the data is
stored in MATLAB, TestStream
objects typically stream data faster than streams
that have data stored on a network or file system.
Creation
Syntax
Description
Row-Based Event Window
ts = testStream
creates a default TestStream
object connected to an event stream hosted by MATLAB. The object reads 100 stream event rows at a time.
ts = testStream(Rows=
creates a
numevents
)TestStream
object that reads numevents
stream
event rows at a time.
Duration-Based Event Window
ts = testStream(Duration=
creates
a timespan
)TestStream
object that reads stream events occurring during the
specified timestamp span, timespan
.
Additional Options
ts = testStream(___,
sets event stream properties
using one or more name-value arguments and any of the previous syntaxes.Name=Value
)
Input Arguments
Properties
Object Functions
readtimetable | Read timetable from event stream |
writetimetable | Write timetable to event stream |
seek | Set read position in event stream |
preview | Preview subset of events from event stream |
identifyingName | Event stream name |
detectImportOptions | Create import options based on event stream content |
detectExportOptions | Create export options based on event stream content |
Examples
Version History
Introduced in R2022b