Adapter for HDFS 9.8 | webMethods Adapter for HDFS Documentation | webMethods Adapter for HDFS Installation and User’s Documentation | Built-In Services | wm.hadoop.hdfs:read
 
wm.hadoop.hdfs:read
The wm.hadoop.hdfs:read service connects to the HDFS cluster and reads a specified file. The service returns the contents of the read file in a specific format.
Input Parameters
handle
String Handle of the HDFS file to which the wm.hadoop.hdfs:read service reads data.
loadAs
String Format in which you want the wm.hadoop.hdfs:read service to make the contents of the HDFS file available to subsequent services. Set to:
*reader to return the contents as a java.io.Reader object.
*file to return the contents to a file on the local computer.
*stream to return the contents as a java.io.InputStream object.
*string to return the contents as a java.io.String object.
*bytes to return the contents as a byte array.
localFilePath
String Optional. The complete path to the file to be created in the local file system.
Specify this parameter only if loadAs is set to file.
readOptions
Document Details to specify for the read operation.
Option
Description
encoding
String Optional. Name of a registered, IANA character set. If you specify an unsupported encoding, the system throws an exception.
localFileCreationMode
String Optional. The mode in which to save the contents of the HDFS file to the local file system.
Specify this parameter only if loadAs is set to file.
Set to:
*create to create a new local file.
*append to append to the contents of an existing local file.
*overwrite to overwrite the contents of an existing local file.
This is the default value.
Output Parameters
status
String The status of the read 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 read operation.
data
Document The data returned by the wm.hadoop.hdfs:read service. The format of the returned data depends on the value of the loadAs input parameter.
*bytes Returns the data as a byte array.
*stream Returns the data as a java.io.InputStream object.
*string Returns the data as a java.io.String object.
*reader Returns the data as a java.io.Reader object.
*filePath Returns the data to a file path on the local computer.