public final class ChangelogSocketExample extends Object
DynamicTableSource and a DecodingFormat.
The example implements a table source with a decoding format that supports changelog semantics.
The SocketDynamicTableFactory illustrates how connector components play together. It
can serve as a reference implementation for implementing own connectors and/or formats.
The SocketDynamicTableSource uses a simple single-threaded SourceFunction to
open a socket that listens for incoming bytes. The raw bytes are decoded into rows by a pluggable
format. The format expects a changelog flag as the first column.
In particular, the example shows how to
FactoryUtil.
Usage: ChangelogSocketExample --hostname <localhost> --port <9999>
Use the following command to ingest data in a terminal:
nc -lk 9999
INSERT|Alice|12
INSERT|Bob|5
DELETE|Alice|12
INSERT|Alice|18
The result is written to stdout.
| Constructor and Description |
|---|
ChangelogSocketExample() |
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.