Read

You can use the Read activity to read data from a file in HDFS and place its content into the Output tab of the activity.

Note: Because of 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 2 GB or more than 2 GB.

General

In the General tab, you can specify the activity name in the process, establish a connection to HDFS, and specify which format you want the file to be read in.

The following table lists the configurations in the General tab of the Read activity:

Field Module Property? Description
Name No The name to be displayed as the label for the activity in the process.
HDFSConnection Yes The HDFS Connection shared resource that is used to create a connection between the plug-in and HDFS. Click to select an HDFS Connection shared resource.

If no matching HDFS Connection shared resources are found, click Create Shared Resource to create one. For more details, see Creating an HDFS Connection.

ReadAs No The format that you want the file to be read in. Select a format from the list:
  • text
  • binary

Description

In the Description tab, you can enter a short description for the Read activity.

Input

In the Input tab, you can specify how you want the file to be read.

The following table lists the input elements in the Input tab of the Read activity:

Input Item Data Type Description
fileName String The path of the file to be read.
offset Long The starting byte position to be read. The value in this field must be 0 or greater.
length Long The number of bytes to be read.
bufferSize Integer The size of the buffer used in transferring data. The value in this field must be greater than 0.
timeout Long The amount of time, in milliseconds, to wait for this activity to complete.

By default, this activity does not time out if you do not specify a value.

Output

In the Output tab, you can view the file content. The output elements of the Read activity vary depending on the file format that you select in the General tab.

The following table lists the output elements in the Output tab of the Read activity:

Output Item Data Type Description
fileContent Complex The file content.

This element contains the textContent or binaryContent element.

text

Content

String The file content in text format.

This item is displayed only when you select text in the ReadAs field in the General tab.

binary

Content

Base64

Binary

The file content in binary format.

This item is displayed only when you select binary in the ReadAs field in the General tab.

end Boolean You can view whether the file has been read to the end.

Fault

In the Fault tab, you can view the error code and error message of the Read activity. See Error Codes for more detailed explanation of errors.

The following table lists the error schema elements in the Fault tab of the Read activity:

Error Schema Element Data Type Description
msg String The error message description that is returned by the plug-in.
msgCode String The error code that is returned by the plug-in.
exception String The exception when the plug-in has internal errors.
message String The error message that is returned by the server.
javaClassName String The name of the Java class where an error occurs.