Package org.apache.hadoop.util.Shell

Examples of org.apache.hadoop.util.Shell.ExitCodeException


    formatter.printHelp("Thrift", null, options,
        "To start the Thrift server run 'bin/hbase-daemon.sh start thrift'\n" +
        "To shutdown the thrift server run 'bin/hbase-daemon.sh stop " +
        "thrift' or send a kill signal to the thrift server pid",
        true);
    throw new ExitCodeException(exitCode, "");
  }
View Full Code Here


    formatter.printHelp("Thrift", null, options,
        "To start the Thrift server run 'bin/hbase-daemon.sh start thrift'\n" +
        "To shutdown the thrift server run 'bin/hbase-daemon.sh stop " +
        "thrift' or send a kill signal to the thrift server pid",
        true);
    throw new ExitCodeException(exitCode, "");
  }
View Full Code Here

    NamespaceSliceDU nssd = namespaceSliceDUMap.get(0);

    // Throw when exit code is not 1
    boolean thrown = false;
    try {
      nssd.processErrorOutput(new ExitCodeException(1, "du: cannot access `a1.txt': No such file or directory"));
    } catch(ExitCodeException ece) {
      thrown = true;
    }
    TestCase.assertTrue(thrown);
   
    Field exitCodeField = Shell.class.getDeclaredField("exitCode");
    exitCodeField.setAccessible(true);
    exitCodeField.set(nssd, 1);
   
    // One single file fails to be accessed.
    nssd.processErrorOutput(new ExitCodeException(1, "du: cannot access `a1.txt': No such file or directory"));

    // Two files fail to be accessed
    nssd.processErrorOutput(new ExitCodeException(1, "du: cannot access `a2.txt': No such file or directory\ndu: cannot access `a3.txt': No such file or directory"));

    // Two files fail to be accessed, one is the same as the previous one
    thrown = false;
    try {
      nssd.processErrorOutput(new ExitCodeException(
          1,
          "du: cannot access `a4.txt': No such file or directory\ndu: cannot access `a3.txt': No such file or directory"));
    } catch (IOException ioe) {
      thrown = true;
    }
    TestCase.assertTrue(thrown);

    // Two files fail to be accessed, one is the same as a previous one
    thrown = false;
    try {
      nssd.processErrorOutput(new ExitCodeException(
          1,
          "du: cannot access `a2.txt': No such file or directory\ndu: cannot access `a5.txt': No such file or directory"));
    } catch (IOException ioe) {
      thrown = true;
    }
    TestCase.assertTrue(thrown)

    // Two files fail to be accessed
    nssd.processErrorOutput(new ExitCodeException(1, "du: cannot access `a6.txt': No such file or directory"));
  }
View Full Code Here

    NamespaceSliceDU nssd = namespaceSliceDUMap.get(0);

    // Throw when exit code is not 1
    boolean thrown = false;
    try {
      nssd.processErrorOutput(new ExitCodeException(1, "du: cannot access `a1.txt': No such file or directory"));
    } catch(ExitCodeException ece) {
      thrown = true;
    }
    TestCase.assertTrue(thrown);
   
    Field exitCodeField = Shell.class.getDeclaredField("exitCode");
    exitCodeField.setAccessible(true);
    exitCodeField.set(nssd, 1);
   
    // One single file fails to be accessed.
    nssd.processErrorOutput(new ExitCodeException(1, "du: cannot access `a1.txt': No such file or directory"));

    // Two files fail to be accessed
    nssd.processErrorOutput(new ExitCodeException(1, "du: cannot access `a2.txt': No such file or directory\ndu: cannot access `a3.txt': No such file or directory"));

    // Two files fail to be accessed, one is the same as the previous one
    thrown = false;
    try {
      nssd.processErrorOutput(new ExitCodeException(
          1,
          "du: cannot access `a4.txt': No such file or directory\ndu: cannot access `a3.txt': No such file or directory"));
    } catch (IOException ioe) {
      thrown = true;
    }
    TestCase.assertTrue(thrown);

    // Two files fail to be accessed, one is the same as a previous one
    thrown = false;
    try {
      nssd.processErrorOutput(new ExitCodeException(
          1,
          "du: cannot access `a2.txt': No such file or directory\ndu: cannot access `a5.txt': No such file or directory"));
    } catch (IOException ioe) {
      thrown = true;
    }
    TestCase.assertTrue(thrown)

    // Two files fail to be accessed
    nssd.processErrorOutput(new ExitCodeException(1, "du: cannot access `a6.txt': No such file or directory"));
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.util.Shell.ExitCodeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.