private void getPolicy(String[] params) throws Exception {
    String command = "getPolicy";
    try {
      // getPolicy -path <path>
      Options getPolicyOptions = new Options();

      String pathOptionName = "path";
      Option policyOption = OptionBuilder.hasArg()
          .isRequired()
          .withLongOpt(pathOptionName)
          .withDescription("Path for which Policy should be fetched")
          .create();
      getPolicyOptions.addOption(policyOption);

      CommandLine args = parseCommandArgs(getPolicyOptions, params);
      String path = args.getOptionValue(pathOptionName);

      HdfsFileErasureCodingPolicy policy = erasureCodingShim.getErasureCodingPolicy(new Path(path));
      writeTestOutput("EC policy is '" + (policy != null ? policy.getName() : "REPLICATED") + "'");

    } 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(), e);
    }
  }
Get an erasure coding policy for a Path.
@param params Parameters passed to the command.
@throws Exception if command failed.
ql/src/java/org/apache/hadoop/hive/ql/processors/ErasureProcessor.java