private void enablePolicy(String[] params) throws Exception {
    String command = "enablePolicy";
    try {
      // enablePolicy -policy <policyName>
      Options enablePolicyOptions = new Options();

      String policyOptionName = "policy";
      Option policyOption = OptionBuilder.hasArg()
          .isRequired()
          .withLongOpt(policyOptionName)
          .withDescription("Policy to enable")
          .hasArg()
          .create();
      enablePolicyOptions.addOption(policyOption);

      CommandLine args = parseCommandArgs(enablePolicyOptions, params);
      String policyName = args.getOptionValue(policyOptionName);

      erasureCodingShim.enableErasureCodingPolicy(policyName);
      writeTestOutput("Enabled EC policy '" + policyName + "'");
    } catch (ParseException pe) {
      writeTestOutput("Error parsing options for " + command + " " + pe.getMessage());
    } catch (Exception e) {
      writeTestOutput("Caught exception running " + command + ": " + e.getMessage());
      throw new Exception("Cannot run " + command + ": " + e.getMessage());
    }
  }
Enable an erasure coding policy.
@param params Parameters passed to the command.
@throws Exception If command failed.
ql/src/java/org/apache/hadoop/hive/ql/processors/ErasureProcessor.java