Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

User Guide· MaxComput e Tunnel MaxComput e

Item Description

T he lifecycle of an upload instance starts when the instance is created and ends
Lif ecycle
when data is uploaded.

Create a data upload instance by calling a constructor method or by using


T ableT unnel.
Creat e a dat a
T he synchronous request mode is used.
uplo ad inst ance
T he server creates a session for the data upload instance and generates a
unique upload ID. You can run the getId command to obtain the upload ID.

T he asynchronous request mode is used.


Call the openRecordWriter method to generate a RecordWriter. T he blockld
Uplo ad dat a parameter identifies the data to upload and the position of the data in the
table. T he value of the blockld parameter ranges from 0 to 20000. If the upload
fails, you can upload the data again based on the block ID.

T he synchronous request mode is used.


Call the getStatus method to obtain the status of an upload session.
V iew t he st at us o f
an uplo ad sessio n Call the getBlockList method to obtain the block IDs of successful upload
sessions. You must check the block IDs of all upload sessions to identify failed
upload sessions. T hen, upload the data of failed sessions again.

T he synchronous request mode is used.


Call the commit(Long[] blocks) method. T he blocks parameter indicates the list
Co mplet e a dat a
of the block IDs of successful upload sessions. T he server verifies the list.
uplo ad
T he verification enhances data accuracy. If the provided list of block IDs is
different from the list on the server, an error is reported.

UNKNOWN: the initial state of a session.


NORMAL: An upload session is created.
CLOSING: T he server sets the upload session to the CLOSING state before it calls
the COMPLET E method to complete the data upload.
St at us
CLOSED: T he data upload is complete. T he data is moved to the directory of the
result table.
EXPIRED: T he upload session times out.
CRIT ICAL: An error occurs.

355 > Document Version: 20220928

You might also like