예제 #1
0
  public static void main(final String[] args) {
    int exitCode = 0;

    try {
      final Configuration configuration = new Configuration(true);
      if (args.length == 1) {
        configuration.addResource(new File(args[0]).toURI().toURL());
      } else if (args.length > 1) {
        throw new ExitSignal(1, "Usage: ./hadoop-repl <path-to-hadoop-core-site-file>");
      }
      new HadoopREPL(configuration).loop("hadoop> ");
    } catch (final ExitSignal ex) {
      System.err.println(ex.getMessage());
      exitCode = ex.getExitCode();
    } catch (final Exception ex) {
      System.err.println(ex);
      exitCode = 1;
    }

    System.exit(exitCode);
  }