@Override public int run(Configuration conf, List<String> args) throws IOException { if (args.size() > 0) { System.err.println(getName() + ": Too many arguments"); return 1; } final DistributedFileSystem dfs = AdminHelper.getDFS(conf); try { final Collection<ErasureCodingPolicyInfo> policies = dfs.getAllErasureCodingPolicies(); if (policies.isEmpty()) { System.out.println("There is no erasure coding policies in the " + "cluster."); } else { System.out.println("Erasure Coding Policies:"); for (ErasureCodingPolicyInfo policy : policies) { if (policy != null) { System.out.println(policy); } } } } catch (IOException e) { System.err.println(AdminHelper.prettifyException(e)); return 2; } return 0; } }
@Override public String getShortUsage() { return "[" + getName() + "]\n"; }
@Override public String getLongUsage() { return getShortUsage() + "\n" + "Get the list of all erasure coding policies.\n"; }