Write

The Write activity is used to write data to a specified file in HDFS.

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.

Append No Specifies whether to append the data to an existing file.
Note: Data cannot be appended to the same file in HDFS by multiple processes simultaneously.
Write Type No Specifies the format of the data to be written.
  • text
  • binary
  • file
  • StreamObject
Overwrite Yes Specifies whether to overwrite the existing data in the specified file.
Note: This field is displayed when the Append check box is cleared.

Description

Provide a short description for the activity.

Input

The input of this activity varies depending on the data format you chose in the General tab. The following table specifies the possible input of the activity.

Input Item Data Type Description
fileName string Specifies the path of the file to be written in.
fileContent string Specifies the content to be written in the file.
Note: This field is displayed when text is selected in the Write Type field in the General tab.
binaryData base64

Binary

Specifies the binary data to be written in the file.
Note: This field is displayed when binary is selected in the Write Type field in the General tab.
sourceFile

Path

string Specifies the path of the file to be written.
Note: This field is displayed when file is selected in the Write Type field in the General tab.
inputStream

Object

Object Specifies the streaming object to be written.
Note: This field is displayed when StreamObject is selected in the Write Type field in the General tab.
overwrite boolean Specifies whether to overwrite the existing data in the source file.
blockSize long Specifies the block size of the file. The value in this field must be greater than 0.
replication short Specifies the number of replications of the file. The value in this field must be greater than 0.
permission integer Specifies the permission of the file. The value in this field must be in the range 0 to 777.
buffersize integer 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 are as follows.

Output Item Data Type Description
status integer Returns standard HTTP status code to indicate whether the execution has succeeded or not.
msg string Returns the execution message.

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.