コード例 #1
0
ファイル: CryptoAdmin.java プロジェクト: aixuebo/had2.6.0
    @Override
    public int run(Configuration conf, List<String> args) throws IOException {
      if (!args.isEmpty()) {
        System.err.println("Can't understand argument: " + args.get(0));
        return 1;
      }

      final DistributedFileSystem dfs = getDFS(conf);
      try {
        final TableListing listing =
            new TableListing.Builder()
                .addField("")
                .addField("", true)
                .wrapWidth(MAX_LINE_WIDTH)
                .hideHeaders()
                .build();
        final RemoteIterator<EncryptionZone> it = dfs.listEncryptionZones();
        while (it.hasNext()) {
          EncryptionZone ez = it.next();
          listing.addRow(ez.getPath(), ez.getKeyName());
        }
        System.out.println(listing.toString());
      } catch (IOException e) {
        System.err.println(prettifyException(e));
        return 2;
      }

      return 0;
    }
コード例 #2
0
ファイル: CryptoAdmin.java プロジェクト: aixuebo/had2.6.0
 @Override
 public String getLongUsage() {
   final TableListing listing = getOptionDescriptionListing();
   listing.addRow(
       "<path>",
       "The path of the encryption zone to create. " + "It must be an empty directory.");
   listing.addRow("<keyName>", "Name of the key to use for the " + "encryption zone.");
   return getShortUsage() + "\n" + "Create a new encryption zone.\n\n" + listing.toString();
 }
コード例 #3
0
ファイル: CryptoAdmin.java プロジェクト: aixuebo/had2.6.0
 @Override
 public String getLongUsage() {
   final TableListing listing = getOptionDescriptionListing();
   listing.addRow(
       "<command-name>",
       "The command for which to get "
           + "detailed help. If no command is specified, print detailed help for "
           + "all commands");
   return getShortUsage() + "\n" + "Get detailed help about a command.\n\n" + listing.toString();
 }