@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 { Map<String, String> codecs = dfs.getAllErasureCodingCodecs(); if (codecs.isEmpty()) { System.out.println("No erasure coding codecs are supported on the " + "cluster."); } else { System.out.println("Erasure Coding Codecs: Codec [Coder List]"); for (Map.Entry<String, String> codec : codecs.entrySet()) { if (codec != null) { System.out.println("\t" + codec.getKey().toUpperCase() + " [" + codec.getValue().toUpperCase() +"]"); } } } } 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 supported erasure coding codecs and coders.\n" + "A coder is an implementation of a codec. A codec can have " + "different implementations, thus different coders.\n" + "The coders for a codec are listed in a fall back order.\n"; }