You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by vi...@apache.org on 2012/06/29 04:28:22 UTC
svn commit: r1355207 - in /incubator/oozie/trunk:
client/src/main/java/org/apache/oozie/cli/OozieCLI.java
core/src/test/java/org/apache/oozie/client/TestOozieCLI.java release-log.txt
Author: virag
Date: Fri Jun 29 02:28:21 2012
New Revision: 1355207
URL: http://svn.apache.org/viewvc?rev=1355207&view=rev
Log:
Adding "-debug" option to Oozie CLI for debug statements to stdout
Modified:
incubator/oozie/trunk/client/src/main/java/org/apache/oozie/cli/OozieCLI.java
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/client/TestOozieCLI.java
incubator/oozie/trunk/release-log.txt
Modified: incubator/oozie/trunk/client/src/main/java/org/apache/oozie/cli/OozieCLI.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/client/src/main/java/org/apache/oozie/cli/OozieCLI.java?rev=1355207&r1=1355206&r2=1355207&view=diff
==============================================================================
--- incubator/oozie/trunk/client/src/main/java/org/apache/oozie/cli/OozieCLI.java (original)
+++ incubator/oozie/trunk/client/src/main/java/org/apache/oozie/cli/OozieCLI.java Fri Jun 29 02:28:21 2012
@@ -123,6 +123,7 @@ public class OozieCLI {
public static final String VERBOSE_OPTION = "verbose";
public static final String VERBOSE_DELIMITER = "\t";
+ public static final String DEBUG_OPTION = "debug";
public static final String PIGFILE_OPTION = "file";
@@ -219,6 +220,7 @@ public class OozieCLI {
Option config = new Option(CONFIG_OPTION, true, "job configuration file '.xml' or '.properties'");
Option submit = new Option(SUBMIT_OPTION, false, "submit a job");
Option run = new Option(RUN_OPTION, false, "run a job");
+ Option debug = new Option(DEBUG_OPTION, false, "Use debug mode to see debugging statements on stdout");
Option rerun = new Option(RERUN_OPTION, true,
"rerun a job (coordinator requires -action or -date, bundle requires -coordinator or -date)");
Option dryrun = new Option(DRYRUN_OPTION, false,
@@ -277,6 +279,7 @@ public class OozieCLI {
jobOptions.addOption(changeValue);
jobOptions.addOption(localtime);
jobOptions.addOption(verbose);
+ jobOptions.addOption(debug);
jobOptions.addOption(offset);
jobOptions.addOption(len);
jobOptions.addOption(filter);
@@ -615,11 +618,11 @@ public class OozieCLI {
protected XOozieClient createXOozieClient(CommandLine commandLine) throws OozieCLIException {
XOozieClient wc = new AuthOozieClient(getOozieUrl(commandLine), getAuthOption(commandLine));
addHeader(wc);
- setDebugMode(wc);
+ setDebugMode(wc,commandLine.hasOption(DEBUG_OPTION));
return wc;
}
- protected void setDebugMode(OozieClient wc) {
+ protected void setDebugMode(OozieClient wc, boolean debugOpt) {
String debug = System.getenv(ENV_OOZIE_DEBUG);
if (debug != null && !debug.isEmpty()) {
@@ -633,6 +636,9 @@ public class OozieCLI {
}
wc.setDebugMode(debugVal);
}
+ else if(debugOpt){ // CLI argument "-debug" used
+ wc.setDebugMode(1);
+ }
}
private static String JOB_ID_PREFIX = "job: ";
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/client/TestOozieCLI.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/client/TestOozieCLI.java?rev=1355207&r1=1355206&r2=1355207&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/client/TestOozieCLI.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/client/TestOozieCLI.java Fri Jun 29 02:28:21 2012
@@ -204,6 +204,30 @@ public class TestOozieCLI extends DagSer
});
}
+ /**
+ * Check if "-debug" option is accepted at CLI with job run command
+ *
+ * @throws Exception
+ */
+ public void testRunWithDebug() throws Exception {
+ runTest(END_POINTS, SERVLET_CLASSES, IS_SECURITY_ENABLED, new Callable<Void>() {
+ public Void call() throws Exception {
+ Path appPath = new Path(getFsTestCaseDir(), "app");
+ getFileSystem().mkdirs(appPath);
+ getFileSystem().create(new Path(appPath, "workflow.xml")).close();
+ String oozieUrl = getContextURL();
+ int wfCount = MockDagEngineService.INIT_WF_COUNT;
+ String[] args = new String[]{"job", "-run", "-oozie", oozieUrl, "-config",
+ createConfigFile(appPath.toString()), "-debug"};
+ assertEquals(0, new OozieCLI().run(args));
+ assertEquals("submit", MockDagEngineService.did);
+ assertTrue(MockDagEngineService.started.get(wfCount));
+
+ return null;
+ }
+ });
+ }
+
public void testStart() throws Exception {
runTest(END_POINTS, SERVLET_CLASSES, IS_SECURITY_ENABLED, new Callable<Void>() {
public Void call() throws Exception {
Modified: incubator/oozie/trunk/release-log.txt
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/release-log.txt?rev=1355207&r1=1355206&r2=1355207&view=diff
==============================================================================
--- incubator/oozie/trunk/release-log.txt (original)
+++ incubator/oozie/trunk/release-log.txt Fri Jun 29 02:28:21 2012
@@ -1,5 +1,6 @@
-- Oozie 3.3.0 release (trunk - unreleased)
+OOZIE-769 Adding "-debug" option to Oozie CLI for debug statements to stdout (mona via virag)
OOZIE-795 update the oozie commit build profile (virag)
OOZIE-860 start-instance and end-instance should limit 1 (britt via virag)
OOZIE-882 CoordELEvaluator.createDataEvaluator doesn't set timezone for coord action (shwethags via tucu)