ChunkTransformer formats all incoming chunks in to row keeps all intermediate state until end of stream. Should use new instance for each request.
Inheritance
Transform > ChunkTransformerPackage
@google-cloud/bigtableConstructors
(constructor)(options)
constructor
(
options
?:
TransformOptions
);
Constructs a new instance of the ChunkTransformer
class
Name | Description |
---|---|
options | TransformOptions
|
Properties
_destroyed
_destroyed
:
boolean
;
family
family
?:
Family
;
lastRowKey
lastRowKey
?:
Value
;
options
options
:
TransformOptions
;
qualifier
qualifier
?:
Qualifier
;
qualifiers
qualifiers
?:
Qualifier
[];
row
row
?:
Row
;
state
state
?:
number
;
Methods
_flush(cb)
_flush
(
cb
:
Function
)
:
void
;
called at end of the stream.
Name | Description |
cb | Function
callback will be called with error if there is any uncommitted row |
Type | Description |
---|---|
void |
_transform(data, enc, next)
_transform
(
data
:
Data
,
enc
:
string
,
next
:
Function
)
:
void
;
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.
Name | Description |
data | Data
readrows response containing array of chunks. |
enc | string
encoding options. |
next | Function
callback will be called once data is processed, with error if any error in processing |
Type | Description |
---|---|
void |
commit()
commit
()
:
void
;
sets lastRowkey and calls reset when row is committed.
Type | Description |
---|---|
void |
destroy(err)
destroy
(
err
?:
Error
)
:
this
;
called when stream is destroyed.
Name | Description |
---|---|
err | Error
error if any |
Type | Description |
---|---|
this |
moveToNextState(chunk)
moveToNextState
(
chunk
:
Chunk
)
:
void
;
Moves to next state in processing.
Name | Description |
---|---|
chunk | Chunk
chunk in process |
Type | Description |
---|---|
void |
processCellInProgress(chunk)
processCellInProgress
(
chunk
:
Chunk
)
:
void
;
Process chunk when in CELl_IN_PROGRESS state.
Name | Description |
---|---|
chunk | Chunk
chunk to process |
Type | Description |
---|---|
void |
processNewRow(chunk)
processNewRow
(
chunk
:
Chunk
)
:
void
;
Process chunk when in NEW_ROW state.
Name | Description |
---|---|
chunk | Chunk
chunk to process |
Type | Description |
---|---|
void |
processRowInProgress(chunk)
processRowInProgress
(
chunk
:
Chunk
)
:
void
;
Process chunk when in ROW_IN_PROGRESS state.
Name | Description |
---|---|
chunk | Chunk
chunk to process |
Type | Description |
---|---|
void |
reset()
reset
()
:
void
;
Resets state of formatter
Type | Description |
---|---|
void |
validateCellInProgress(chunk)
validateCellInProgress
(
chunk
:
Chunk
)
:
void
;
Validates chunk for cellInProgress state.
Name | Description |
---|---|
chunk | Chunk
chunk to validate |
Type | Description |
---|---|
void |
validateNewRow(chunk, newRowKey)
validateNewRow
(
chunk
:
Chunk
,
newRowKey
:
string
|
Buffer
)
:
void
;
Validates state for new row.
Name | Description |
chunk | Chunk
chunk to validate |
newRowKey | string | __global.Buffer
newRowKey of the new row |
Type | Description |
---|---|
void |
validateResetRow(chunk)
validateResetRow
(
chunk
:
Chunk
)
:
void
;
Validates resetRow condition for chunk
Name | Description |
chunk | Chunk
chunk to validate for resetrow |
Type | Description |
---|---|
void |
validateRowInProgress(chunk)
validateRowInProgress
(
chunk
:
Chunk
)
:
void
;
Validates state for rowInProgress
Name | Description |
---|---|
chunk | Chunk
chunk to validate |
Type | Description |
---|---|
void |
validateValueSizeAndCommitRow(chunk)
validateValueSizeAndCommitRow
(
chunk
:
Chunk
)
:
void
;
Validates valuesize and commitrow in a chunk
Name | Description |
chunk | Chunk
chunk to validate for valuesize and commitRow |
Type | Description |
---|---|
void |