Erasure Coding Examples

You can use the HDFS EX command with its various options to set the erasure coding policies on directories.

Viewing the list of erasure coding policies

The following example shows how you can view the list of available erasure coding policies:

Bash
Copy

Enabling an erasure coding policy

In the previous example, the list of erasure coding policies indicate that RS-6-3-1024k is already enabled. If required, you can enable additional policies as mentioned in the following example:

Bash
Copy

Setting an erasure coding policy

The following example shows how you can set the erasure coding policy RS-6-3-1024kon a particular directory:

Bash
Copy

To confirm whether the specified directory has the erasure coding policy applied, run the hdfs ec -getPolicy command:

Bash
Copy

Checking the block status on an erasure-coded directory

After enabling erasure coding on a directory, you can check the block status by running the hdfs fsck command. The following example output shows the status of the erasure-coded blocks:

Bash
Copy

Changing the erasure coding policy

You can use the hdfs ec setPolicy command to change the erasure coding policy applied on a particular directory.

Bash
Copy

You can check the block status after applying the new policy. The following example output shows the status of the erasure-coded blocks for a directory that has the RS-3-2-1024k policy:

Bash
Copy

You can apply the default 3x replication policy and check the block status as specified in the following examples:

Bash
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated