Updated on 2022-09-14 GMT+08:00

FS Action

Function

The FS Action node is a Hadoop distributed file system (HDFS) operation node. You can create and delete HDFS files and folders and grant permissions for HDFS files and folders using this node.

Parameter Description

Table 1 describes parameters used on the FS Action node.

Table 1 Parameters

Parameter

Meaning

name

Identifies an FS action.

delete

Deletes a specified file or folder.

move

Moves a file from the source directory to the target directory.

chmod

Modifies file or folder access rights.

path

Indicates the current file path.

source

Indicates the source file path.

target

Indicates the target file path.

permissions

Indicates permissions.

${variable name} indicates the value defined in job.properties.

For example, ${nameNode} indicates hdfs://hacluster. (See job.properties.)

Example Codes

<action name="copyData">
    <fs>
        <delete path='${nameNode}/user/oozie_cli/${dataLoadRoot}/result'/>
        <move source='${nameNode}/user/${wf:user()}/${dataLoadRoot}/output-data/map-reduce' target='${nameNode}/user/oozie_cli/${dataLoadRoot}/result'/>
        <chmod path='${nameNode}/user/oozie_cli/${dataLoadRoot}/reuslt' permissions='-rwxrw-rw-' dir-files='true'></chmod>
     </fs>
     <ok to="end"/>
     <error to="fail"/>
</action>