2. HDFS Connector
The Anypoint Connector for the Hadoop Distributed File System (HDFS) uses as a
bi-directional gateway between Mule applications and your Apache Hadoop
instance.
4. Configuring a Global Element
To use the HDFS connector in your Mule application, you must configure a global
HDFS element that can be used by all the HDFS connectors in the application
6. These steps to configure a HDFS
connector in your application
Create a global HDFS configuration outside and above your flows, using the
following global configuration code.
<!-- Simple configuration -->
<hdfs:config nameNodeUri="${mule.HDFS.nameNodeUri}"
username="${mule.HDFS.username}"/>
7. Using the Connector
HDFS connector is an operation-based connector, which means that when you add the connector to
your flow, you need to configure a specific operation for the connector to perform. The HDFS connector
currently supports the following list of operations:
Operation
1. Append to File
2. Copy from Local File
3. Copy to Local File
4. Delete Directories
5. Delete File
6. Get Path Meta Data
7. Glob Status
8. List Status
9. Make Directories
10. Read from Path
11. Rename
12. Set Owner
13. Set Permission
14. Write to Path
9. 1.Drag an HTTP connector into the canvas, then select it to open the properties editor console.
2.Add a new HTTP Listener Configuration global element:
3.Configure the following HTTP parameters:
4.Add a Logger scope to print the name of the file that needs to be created in the Mule Console. Configure the
Logger according to the table below.
5.Add a Set Payload transformer to set the message input as payload, configuring it according to the table
below.
6.Drag the HDFS connector onto the canvas, and select it to open the properties editor console.
7.Click the plus sign next to the Connector Configuration field to add a new global connector configuration.
8.Configure the global element according to the table below.
10.
11. Back in the properties editor of the HDFS connector in your application, configure the remaining parameters
according to the table below.
Run the project as a Mule Application (right-click the project name and clickRun As > Mule Application).
From a browser, navigate to http://localhost:8090/path=filecreate