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

SizeByteBuffer Protocol Handler
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

SizeByteBuffer Protocol Handler
CREATE STREAM buffer (symbol String, points Double)   
    WRAPPER 'GenericPush'
    PROTOCOL 'SizeByteBuffer'
    TRANSPORT 'NonBlockingTcp'
    DATAHANDLER 'Tuple'
    OPTIONS ( 'start' '0x1', 'end' '0x2' , 'port' '65321', 'host' 'localhost')
  • No labels