This handler initially reads 4 byte and interpreting them as input size. The byte order is the java byte order (BIG_ENDIAN) or can be set with the parameter ByteOrder to "LITTLE_ENDIAN". After reading size bytes the Buffer is send to the data handler.
Options
- byteorder: The byte order of the byte stream (BID_ENDIAN or LITTLE_ENDIAN)
Example
PQL
Code Block |
---|
theme | Eclipse |
---|
language | javascript |
---|
title | SizeByteBuffer Protocol Handler |
---|
linenumbers | true |
---|
|
input = ACCESS({source='Buffer', wrapper='GenericPush',
transport='NonBlockingTcp',protocol='SizeByteBuffer',
dataHandler='Tuple',options=[['byteorder','BIG_ENDIAN'],['port','65321'], ['host','localhost']],
schema=[
['symbol','String'],
['points','Double'] ]
}) |
CQL
Code Block |
---|
theme | Eclipse |
---|
language | sql |
---|
title | SizeByteBuffer Protocol Handler |
---|
linenumbers | true |
---|
|
CREATE STREAM buffer (symbol String, points Double)
WRAPPER 'GenericPush'
PROTOCOL 'SizeByteBuffer'
TRANSPORT 'NonBlockingTcp'
DATAHANDLER 'Tuple'
OPTIONS ( 'start' '0x1', 'end' '0x2' , 'port' '65321', 'host' 'localhost') |