| Namespace | http://www.mulesoft.org/schema/mule/hdfs |
|---|---|
| Schema Location | http://www.mulesoft.org/schema/mule/hdfs/current/mule-hdfs.xsd (View Schema) |
| Schema Version | 3.4 |
| Minimum Mule Version | 3.3.0 |
Hadoop Distributed File System (HDFS) Connector.
| Configuration | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Configure an instance of this module
| |||||||||||
| Message Processors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Append the current payload to a file located at the designated path.
| |||||||||||
Delete the file or directory located at the designated path.
| |||||||||||
Delete the file or directory located at the designated path.
| |||||||||||
Get the metadata of a path, as described in
readFromPath(String, int, SourceCallback), and store it
in flow variables. | |||||||||||
Make the given file and all non-existent parents into directories.
| |||||||||||
Read the content of a file designated by its path and streams it to the rest
of the flow, while adding the path metadata in the following inbound
properties:
| |||||||||||
Write the current payload to the designated path, either creating a new file
or appending to an existing one.
| |||||||||||
To use the this module within a flow the namespace to the module must be included. The resulting flow will look similar to the following:
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:hdfs="http://www.mulesoft.org/schema/mule/hdfs"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/hdfs
http://www.mulesoft.org/schema/mule/hdfs/current/mule-hdfs.xsd">
<!-- here goes your flows and configuration elements -->
</mule>
This module is configured using the config element. This element must be placed outside of your flows and at the root of your Mule application. You can create as many configurations as you deem necessary as long as each carries its own name.
Each message processor, message source or transformer carries a config-ref attribute that allows the invoker to specify which configuration to use.
| Attributes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Type | Name | Default Value | Description | Java Type | MIME Type | Encoding | Optional. Give a name to this configuration so it can be later referenced. | ||||
| Optional. A Map of configuration entries to be used by the HDFS client. | |||||||||||
| Optional. A List of configuration resource files to be loaded by the HDFS client. | |||||||||||
| Optional. The name of the file system to connect to. | |||||||||||
| Optional. A readily configured FileSystem to use to connect to HDFS. | |||||||||||
INCLUDE_ERROR
INCLUDE_ERROR
INCLUDE_ERROR
This connector offers automatic connection management via the use of a connection pool. The pool will act a storage mechanism for all the connections that are in-use by the user of this connector.
Prior to execution of a processor, the connector will attempt to lookup an already established connection and if one doesn't exists it will create one. That lookup mechanism is done in the connection pool via the use of connection variables declared as keys.
The user of the connector can configure the pool by adding a connection-pooling-profile to the connector configuration like this:
<hdfs:connection-pooling-profile maxActive="10" maxIdle="10"
exhaustedAction="WHEN_EXHAUSTED_GROW" maxWait="120" minEvictionMillis="60000" evictionCheckIntervalMillis="30000"/>
The following is a list of connection attributes, each connection attribute can be configured at the config element level or they can also be added to each processor. If they are used at the processor level they get the benefit of full expression resolution.
| Connection Attributes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
| Optional. Specify which configuration to use. | |||||||||||
| A connection key. | String | */* | UTF-8 | ||||||||
Reconnection Strategies specify how a connector behaves when its connection fails. You can control how Mule attempts to reconnect by specifying a number of criteria:
With a reconnection strategy, you can better control the behavior of a failed connection, by configuring it, for example, to re-attempt the connection only once every 15 minutes, and to give up after 30 attempts. You can also send an automatic notification to your IT administrator whenever this reconnection strategy goes into effect. You can even define a strategy that attempts to reconnect only during business hours. Such a setting can prove useful if your server is frequently shut down for nightly maintenance.
A reconnection strategy that allows the user to configure how many times a reconnection should be attempted and how long to wait between attempts.
<hdfs:config>
<reconnect count="5" frequency="1000"/>
</hdfs:config>
| Reconnect Attributes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Name | Default Value | Description | |||||||||
| Optional. How often (in ms) to reconnect | |||||||||||
| Optional. How many reconnection attempts to make | |||||||||||
For more information about reconnection strategies in Mule, or even how to write your own custom reconnection strategy please check this section.
Append the current payload to a file located at the designated path. Note: by default the Hadoop server has the append option disabled. In order to be able append any data to an existing file refer to dfs.support.append configuration parameter
INCLUDE_ERROR
INCLUDE_ERROR
| Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Optional. Specify which configuration to use. | |||||||||||
| The path of the file to write to. | String | */* | UTF-8 | ||||||||
| 4096 | Optional. The buffer size to use when appending to the file. | int | */* | ||||||||
| The payload to append to the file. | InputStream | */* | |||||||||
| Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
| DEFAULT | Optional. A connection key. | String | */* | UTF-8 | |||||||
| Payload Class | Description |
|---|---|
| Exception | if any issue occurs during the execution. |
Delete the file or directory located at the designated path.
INCLUDE_ERROR
| Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Optional. Specify which configuration to use. | |||||||||||
| The path of the directory to delete. | String | */* | UTF-8 | ||||||||
| Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
| DEFAULT | Optional. A connection key. | String | */* | UTF-8 | |||||||
| Payload Class | Description |
|---|---|
| Exception | if any issue occurs during the execution. |
Delete the file or directory located at the designated path.
INCLUDE_ERROR
| Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Optional. Specify which configuration to use. | |||||||||||
| The path of the file to delete. | String | */* | UTF-8 | ||||||||
| Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
| DEFAULT | Optional. A connection key. | String | */* | UTF-8 | |||||||
| Payload Class | Description |
|---|---|
| Exception | if any issue occurs during the execution. |
Get the metadata of a path, as described in
readFromPath(String, int, SourceCallback), and store it
in flow variables.
INCLUDE_ERROR
| Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Optional. Specify which configuration to use. | |||||||||||
| The path whose existence must be checked. | String | */* | UTF-8 | ||||||||
| The MuleEvent currently being processed. | MuleEvent | */* | |||||||||
| Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
| DEFAULT | Optional. A connection key. | String | */* | UTF-8 | |||||||
| Return Type | Description |
|---|---|
| void | the result of executing the next message processors if the path exists, otherwise null. |
| Payload Class | Description |
|---|---|
| Exception | if any issue occurs during the execution. |
Make the given file and all non-existent parents into directories. Has the semantics of Unix 'mkdir -p'. Existence of the directory hierarchy is not an error.
INCLUDE_ERROR
INCLUDE_ERROR
| Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Optional. Specify which configuration to use. | |||||||||||
| The path to create directories for. | String | */* | UTF-8 | ||||||||
| Optional. The file system permission to use when creating the directories, either in octal or symbolic format (umask). | String | */* | UTF-8 | ||||||||
| Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
| DEFAULT | Optional. A connection key. | String | */* | UTF-8 | |||||||
| Payload Class | Description |
|---|---|
| Exception | if any issue occurs during the execution. |
Read the content of a file designated by its path and streams it to the rest of the flow, while adding the path metadata in the following inbound properties:
HDFS_PATH_EXISTS: a boolean set to true if the path
existsHDFS_CONTENT_SUMMARY: an instance of
ContentSummary if the path exists.HDFS_FILE_STATUS: an instance of FileStatus
if the path exists.HDFS_FILE_CHECKSUM: an instance of
FileChecksum if the path exists, is a file and has a checksum.INCLUDE_ERROR
INCLUDE_ERROR
| Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Optional. Specify which configuration to use. | |||||||||||
| The path of the file to read. | String | */* | UTF-8 | ||||||||
| 4096 | Optional. The buffer size to use when reading the file. | int | */* | ||||||||
| The SourceCallback used to propagate the event to the rest of the flow. | SourceCallback | */* | |||||||||
| Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
| DEFAULT | Optional. A connection key. | String | */* | UTF-8 | |||||||
| Return Type | Description |
|---|---|
| Object | the result from executing the rest of the flow. |
| Payload Class | Description |
|---|---|
| Exception | if any issue occurs during the execution. |
Write the current payload to the designated path, either creating a new file or appending to an existing one.
INCLUDE_ERROR
INCLUDE_ERROR
| Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Optional. Specify which configuration to use. | |||||||||||
| The path of the file to write to. | String | */* | UTF-8 | ||||||||
| Optional. The file system permission to use if a new file is created, either in octal or symbolic format (umask). | String | */* | UTF-8 | ||||||||
| true | Optional. If a pre-existing file should be overwritten with the new content. | boolean | */* | ||||||||
| 4096 | Optional. The buffer size to use when appending to the file. | int | */* | ||||||||
| 1 | Optional. Block replication for the file. | int | */* | ||||||||
| 4096 | Optional. The buffer size to use when appending to the file. | long | */* | ||||||||
| Optional. The username owner of the file. | String | */* | UTF-8 | ||||||||
| Optional. The group owner of the file. | String | */* | UTF-8 | ||||||||
| The payload to write to the file. | InputStream | */* | |||||||||
| Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
| DEFAULT | Optional. A connection key. | String | */* | UTF-8 | |||||||
| Payload Class | Description |
|---|---|
| Exception | if any issue occurs during the execution. |