ChunkTransformer
Source: chunktransformer.
ChunkTransformer formats all incoming chunks in to row keeps all intermediate state until end of stream. Should use new instance for each request.
new ChunkTransformer()
Methods
_flush(cb)
called at end of the stream.
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
cb |
callback |
|
callback will be called with error if there is any uncommitted row |
_transform(data[, enc], 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 | Optional | Description |
|---|---|---|---|
|
data |
object |
|
readrows response containing array of chunks. |
|
enc |
object |
Yes |
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.
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
err |
error |
|
error if any |