The TCPServer transport handler allows the propagation of results over TCP/IP as a server. This transport handler can be used in both directions, other client can connect to this server to receive data and to publish data.

Options

  • port: The port to listen for connections

  • read: The size of the read buffer (optional)

  • write: The size of the write buffer (optional)

  • maxBufferSize: If this value is given at the value is larger than 0, the handler caches maxBufferSize elements of the output stream. When a new client connects it first will get the cached elements.

Example

PQL

TCPServer Transport Handler
input = ACCESS({source='Source',
wrapper='GenericPush',
transport='TCPServer',
protocol='CSV',
dataHandler='Tuple',
options=[['port', '8080'],['read', '10240'],['write', '10240']],
schema=[
['id', 'Double'],
['data', 'String']]
})

output = SENDER({sink='Sink',
wrapper='GenericPush',
transport='TCPServer',
protocol='CSV',
dataHandler='Tuple',
options=[['port', '8081'],['read', '10240'],['write', '10240']]
}, input)

CQL

TCPServer Transport Handler
CREATE STREAM source (id Double, data STRING)
    WRAPPER 'GenericPush'
    PROTOCOL 'CSV'
    TRANSPORT 'TCPServer'
    DATAHANDLER 'Tuple'
    OPTIONS ( 'port' '8080', 'read' '10240', 'write' '10240')


CREATE SINK sink (id Double, data STRING)
    WRAPPER 'GenericPush'
    PROTOCOL 'CSV'
    TRANSPORT 'TCPServer'
    DATAHANDLER 'Tuple'
    OPTIONS ( 'port' '8080', 'read' '10240', 'write' '10240')

  • No labels