ChunkTransformer

ChunkTransformer

ChunkTransformer formats all incoming chunks in to row keeps all intermediate state until end of stream. Should use new instance for each request.

Constructor

new ChunkTransformer()

Methods

_flush(cb)

called at end of the stream.

Parameters:
Name Type Description
cb callback

callback will be called with error if there is any uncommitted row

_transform(data, _encodingopt, next)

transform the readrowsresponse chunks into friendly format. Chunks contain 3 properties:

rowContents The row contents, this essentially is all data pertaining to a single family.

commitRow This is a boolean telling us the all previous chunks for this row are ok to consume.

resetRow This is a boolean telling us that all the previous chunks are to be discarded.

Parameters:
Name Type Attributes Description
data object

readrows response containing array of chunks.

_encoding object <optional>

encoding options.

next callback

callback will be called once data is processed, with error if any error in processing

destroy(err)

called when stream is destroyed.

Parameters:
Name Type Description
err error

error if any