Java Code Examples for org.apache.hadoop.hdfs.DFSUtil#parseHelpArgument()

The following examples show how to use org.apache.hadoop.hdfs.DFSUtil#parseHelpArgument() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NameNode.java    From hadoop with Apache License 2.0 6 votes vote down vote up
/**
 */
public static void main(String argv[]) throws Exception {
  if (DFSUtil.parseHelpArgument(argv, NameNode.USAGE, System.out, true)) {
    System.exit(0);
  }

  try {
    StringUtils.startupShutdownMessage(NameNode.class, argv, LOG);
    NameNode namenode = createNameNode(argv, null);
    if (namenode != null) {
      namenode.join();
    }
  } catch (Throwable e) {
    LOG.error("Failed to start namenode.", e);
    terminate(1, e);
  }
}
 
Example 2
Source File: DFSZKFailoverController.java    From big-c with Apache License 2.0 6 votes vote down vote up
public static void main(String args[])
    throws Exception {
  if (DFSUtil.parseHelpArgument(args, 
      ZKFailoverController.USAGE, System.out, true)) {
    System.exit(0);
  }
  
  GenericOptionsParser parser = new GenericOptionsParser(
      new HdfsConfiguration(), args);
  DFSZKFailoverController zkfc = DFSZKFailoverController.create(
      parser.getConfiguration());
  int retCode = 0;
  try {
    retCode = zkfc.run(parser.getRemainingArgs());
  } catch (Throwable t) {
    LOG.fatal("Got a fatal error, exiting now", t);
  }
  System.exit(retCode);
}
 
Example 3
Source File: DFSZKFailoverController.java    From hadoop with Apache License 2.0 6 votes vote down vote up
public static void main(String args[])
    throws Exception {
  if (DFSUtil.parseHelpArgument(args, 
      ZKFailoverController.USAGE, System.out, true)) {
    System.exit(0);
  }
  
  GenericOptionsParser parser = new GenericOptionsParser(
      new HdfsConfiguration(), args);
  DFSZKFailoverController zkfc = DFSZKFailoverController.create(
      parser.getConfiguration());
  int retCode = 0;
  try {
    retCode = zkfc.run(parser.getRemainingArgs());
  } catch (Throwable t) {
    LOG.fatal("Got a fatal error, exiting now", t);
  }
  System.exit(retCode);
}
 
Example 4
Source File: NameNode.java    From big-c with Apache License 2.0 6 votes vote down vote up
/**
 */
public static void main(String argv[]) throws Exception {
  if (DFSUtil.parseHelpArgument(argv, NameNode.USAGE, System.out, true)) {
    System.exit(0);
  }

  try {
    StringUtils.startupShutdownMessage(NameNode.class, argv, LOG);
    NameNode namenode = createNameNode(argv, null);
    if (namenode != null) {
      namenode.join();
    }
  } catch (Throwable e) {
    LOG.error("Failed to start namenode.", e);
    terminate(1, e);
  }
}
 
Example 5
Source File: GetGroups.java    From hadoop with Apache License 2.0 5 votes vote down vote up
public static void main(String[] argv) throws Exception {
  if (DFSUtil.parseHelpArgument(argv, USAGE, System.out, true)) {
    System.exit(0);
  }
  
  int res = ToolRunner.run(new GetGroups(new HdfsConfiguration()), argv);
  System.exit(res);
}
 
Example 6
Source File: GetGroups.java    From big-c with Apache License 2.0 5 votes vote down vote up
public static void main(String[] argv) throws Exception {
  if (DFSUtil.parseHelpArgument(argv, USAGE, System.out, true)) {
    System.exit(0);
  }
  
  int res = ToolRunner.run(new GetGroups(new HdfsConfiguration()), argv);
  System.exit(res);
}
 
Example 7
Source File: GetConf.java    From big-c with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
  if (DFSUtil.parseHelpArgument(args, USAGE, System.out, true)) {
    System.exit(0);
  }
  
  int res = ToolRunner.run(new GetConf(new HdfsConfiguration()), args);
  System.exit(res);
}
 
Example 8
Source File: DFSck.java    From big-c with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
  // -files option is also used by GenericOptionsParser
  // Make sure that is not the first argument for fsck
  int res = -1;
  if ((args.length == 0) || ("-files".equals(args[0]))) {
    printUsage(System.err);
    ToolRunner.printGenericCommandUsage(System.err);
  } else if (DFSUtil.parseHelpArgument(args, USAGE, System.out, true)) {
    res = 0;
  } else {
    res = ToolRunner.run(new DFSck(new HdfsConfiguration()), args);
  }
  System.exit(res);
}
 
Example 9
Source File: DataNode.java    From big-c with Apache License 2.0 5 votes vote down vote up
public static void main(String args[]) {
  if (DFSUtil.parseHelpArgument(args, DataNode.USAGE, System.out, true)) {
    System.exit(0);
  }

  secureMain(args, null);
}
 
Example 10
Source File: Balancer.java    From big-c with Apache License 2.0 5 votes vote down vote up
/**
 * Run a balancer
 * @param args Command line arguments
 */
public static void main(String[] args) {
  if (DFSUtil.parseHelpArgument(args, USAGE, System.out, true)) {
    System.exit(0);
  }

  try {
    System.exit(ToolRunner.run(new HdfsConfiguration(), new Cli(), args));
  } catch (Throwable e) {
    LOG.error("Exiting balancer due an exception", e);
    System.exit(-1);
  }
}
 
Example 11
Source File: Mover.java    From big-c with Apache License 2.0 5 votes vote down vote up
/**
 * Run a Mover in command line.
 *
 * @param args Command line arguments
 */
public static void main(String[] args) {
  if (DFSUtil.parseHelpArgument(args, Cli.USAGE, System.out, true)) {
    System.exit(0);
  }

  try {
    System.exit(ToolRunner.run(new HdfsConfiguration(), new Cli(), args));
  } catch (Throwable e) {
    LOG.error("Exiting " + Mover.class.getSimpleName()
        + " due to an exception", e);
    System.exit(-1);
  }
}
 
Example 12
Source File: OzoneGetConf.java    From hadoop-ozone with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
  if (DFSUtil.parseHelpArgument(args, USAGE, System.out, true)) {
    System.exit(0);
  }

  OzoneConfiguration conf = new OzoneConfiguration();
  conf.addResource(new OzoneConfiguration());
  int res = ToolRunner.run(new OzoneGetConf(conf), args);
  System.exit(res);
}
 
Example 13
Source File: GetConf.java    From hadoop with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
  if (DFSUtil.parseHelpArgument(args, USAGE, System.out, true)) {
    System.exit(0);
  }
  
  int res = ToolRunner.run(new GetConf(new HdfsConfiguration()), args);
  System.exit(res);
}
 
Example 14
Source File: DFSck.java    From hadoop with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
  // -files option is also used by GenericOptionsParser
  // Make sure that is not the first argument for fsck
  int res = -1;
  if ((args.length == 0) || ("-files".equals(args[0]))) {
    printUsage(System.err);
    ToolRunner.printGenericCommandUsage(System.err);
  } else if (DFSUtil.parseHelpArgument(args, USAGE, System.out, true)) {
    res = 0;
  } else {
    res = ToolRunner.run(new DFSck(new HdfsConfiguration()), args);
  }
  System.exit(res);
}
 
Example 15
Source File: DataNode.java    From hadoop with Apache License 2.0 5 votes vote down vote up
public static void main(String args[]) {
  if (DFSUtil.parseHelpArgument(args, DataNode.USAGE, System.out, true)) {
    System.exit(0);
  }

  secureMain(args, null);
}
 
Example 16
Source File: Balancer.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/**
 * Run a balancer
 * @param args Command line arguments
 */
public static void main(String[] args) {
  if (DFSUtil.parseHelpArgument(args, USAGE, System.out, true)) {
    System.exit(0);
  }

  try {
    System.exit(ToolRunner.run(new HdfsConfiguration(), new Cli(), args));
  } catch (Throwable e) {
    LOG.error("Exiting balancer due an exception", e);
    System.exit(-1);
  }
}
 
Example 17
Source File: Mover.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/**
 * Run a Mover in command line.
 *
 * @param args Command line arguments
 */
public static void main(String[] args) {
  if (DFSUtil.parseHelpArgument(args, Cli.USAGE, System.out, true)) {
    System.exit(0);
  }

  try {
    System.exit(ToolRunner.run(new HdfsConfiguration(), new Cli(), args));
  } catch (Throwable e) {
    LOG.error("Exiting " + Mover.class.getSimpleName()
        + " due to an exception", e);
    System.exit(-1);
  }
}