Read

The Read activity is used to read data from a file in HDFS and place its content into the Output tab of the activity.

Note: Due to the limitations of TIBCO ActiveMatrix BusinessWorks, this activity cannot read more than 2 GB data at one time. You can use the group to iteratively read the data in a file of more than 2 GB.

General

The General tab has the following fields.

Field Module Property? Description
Name No The name of the activity in the process definition.
HDFS Connection Yes Click to select an HDFS Connection shared resource.

If no matching HDFS Connection shared resources are found, click Create Shared Resource to create one.

Read As No Specifies in what format the file to be read as, text or binary.

Description

Provide a short description for the activity.

Input

The input of the activity are as follows.

Input Item Data Type Description
fileName string Specifies the path of the file to be read.
offset long Specifies the starting byte position to be read. The value in this field must be greater than 0.
length long Specifies the number of bytes to be read.
bufferSize long Specifies the size of the buffer used in transferring data. The value in this field must be greater than 0.

Output

The output of the activity varies depending on the file format you chose in the General tab .

Output Item Data Type Description
fileContent binary

Content

base64

Binary

Returns the file content in binary format.
Note: This item is displayed when binary is selected in the Read As field in the General tab.
textContent string Returns the file content in text format.
Note: This item is displayed when text is selected in the Read As field in the General tab.
end boolean Returns whether the file has been read to the end.

Fault

The Fault tab lists the exceptions that can be thrown by this activity.

HDFSException Description
msg The error message description returned by the plug-in.
msgCode The error code returned by the plug-in.
exception Occurs when the plug-in has internal errors.
message The error message returned by the server.
javaClassName The name of the Java Class where an error occurred.