wm.hadoop.hdfs:open

The wm.hadoop.hdfs:open service enables you to open a stream to an HDFS file to perform read and write operations. In addition, the service allows you to specify rollover properties for writing to the file based on its size or the duration of the write operation.

Input Parameters

ConnectionName String Name of the Adapter for HDFS connection for connecting to the HDFS cluster.
hdfsFilePath String Path to the HDFS file to open. You can specify either the relative path to the file (for example, files/abc.txt) or its absolute path (for example, /users/hduser/files/abc.txt).
rolloverType String Type of rollover to be performed. You can specify either the file size or duration for the write operation.

Specify the following parameters only if you want the write operation to be performed until the file reaches a specified size or for a specified duration. After the specified file size or duration is reached, the write operation continues in a new file.

Set to:
  • FileSizeRollover to create a new file when the file reaches a certain size . The unit of size for rollover is in bytes for the rollover.
  • TimeRollover to create a new file for the write operation after a specified duration. The unit of time for rollover is in seconds for the rollover.
openType String Specifying the type of operation to be performed for which the file is being opened.
Set to:
  • Write to write data to a specified HDFS location.
  • Read to read data and make the contents of the HDFS file available to subsequent services.
rolloverUnit String Specify the unit of the rollover for write operations.
writeMode String The mode in which to write to the specified HDFS file.

Specify this parameter only if openType is set to Write.

Set to:
  • create to create a new HDFS file.
  • append to append to the contents of an existing HDFS file.
  • overwrite to overwrite the contents of an existing HDFS file.

    This is the default value.

permissions String Name of a registered, IANA character set. If you specify an unsupported encoding, the system throws an exception

Output Parameters

status String The status of the open operation. The valid value of this parameter can either be success or failure.
message String A detailed message specifying the reason for the success or failure of the open operation.
handle String Handle of the HDFS file to which the stream is opened.