Class ChunkTransformer (6.0.0)

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 >ChunkTransformer

Package

@google-cloud/bigtable

Constructors

(constructor)(options)

constructor(options?:TransformOptions);

Constructs a new instance of theChunkTransformer class

Parameter
NameDescription
optionsTransformOptions

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.

Parameter
NameDescription
cbFunction

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

Returns
TypeDescription
void

_transform(data, _encoding, next)

_transform(data:Data,_encoding: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.

Parameters
NameDescription
dataData

readrows response containing array of chunks.

_encodingstring

encoding options.

nextFunction

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

Returns
TypeDescription
void

commit()

commit():void;

sets lastRowkey and calls reset when row is committed.

Returns
TypeDescription
void

destroy(err)

destroy(err?:Error):this;

called when stream is destroyed.

Parameter
NameDescription
errError

error if any

Returns
TypeDescription
this

moveToNextState(chunk)

moveToNextState(chunk:Chunk):void;

Moves to next state in processing.

Parameter
NameDescription
chunkChunk

chunk in process

Returns
TypeDescription
void

processCellInProgress(chunk)

processCellInProgress(chunk:Chunk):void;

Process chunk when in CELl_IN_PROGRESS state.

Parameter
NameDescription
chunkChunk

chunk to process

Returns
TypeDescription
void

processNewRow(chunk)

processNewRow(chunk:Chunk):void;

Process chunk when in NEW_ROW state.

Parameter
NameDescription
chunkChunk

chunk to process

Returns
TypeDescription
void

processRowInProgress(chunk)

processRowInProgress(chunk:Chunk):void;

Process chunk when in ROW_IN_PROGRESS state.

Parameter
NameDescription
chunkChunk

chunk to process

Returns
TypeDescription
void

reset()

reset():void;

Resets state of formatter

Returns
TypeDescription
void

validateCellInProgress(chunk)

validateCellInProgress(chunk:Chunk):void;

Validates chunk for cellInProgress state.

Parameter
NameDescription
chunkChunk

chunk to validate

Returns
TypeDescription
void

validateNewRow(chunk, newRowKey)

validateNewRow(chunk:Chunk,newRowKey:string|Buffer):void;

Validates state for new row.

Parameters
NameDescription
chunkChunk

chunk to validate

newRowKeystring |"\"buffer\"".__global.Buffer

newRowKey of the new row

Returns
TypeDescription
void

validateResetRow(chunk)

validateResetRow(chunk:Chunk):void;

Validates resetRow condition for chunk

Parameter
NameDescription
chunkChunk

chunk to validate for resetrow

Returns
TypeDescription
void

validateRowInProgress(chunk)

validateRowInProgress(chunk:Chunk):void;

Validates state for rowInProgress

Parameter
NameDescription
chunkChunk

chunk to validate

Returns
TypeDescription
void

validateValueSizeAndCommitRow(chunk)

validateValueSizeAndCommitRow(chunk:Chunk):void;

Validates valuesize and commitrow in a chunk

Parameter
NameDescription
chunkChunk

chunk to validate for valuesize and commitRow

Returns
TypeDescription
void

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-30 UTC.