You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bigtop.apache.org by rv...@apache.org on 2017/03/23 17:27:33 UTC

[02/50] [abbrv] bigtop git commit: Added logging and return in catch blocks from Alan's comments.

Added logging and return in catch blocks from Alan's comments.

(cherry picked from commit 84eef9f47d05392f7b8710c3897fa3bf47bca796)


Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo
Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/a9be6752
Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/a9be6752
Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/a9be6752

Branch: refs/heads/master
Commit: a9be67525558cbb5651181966297b00de78fc9a3
Parents: 62dbaf7
Author: Raj Desai <rd...@us.ibm.com>
Authored: Thu Oct 27 10:31:24 2016 -0700
Committer: Roman Shaposhnik <rv...@apache.org>
Committed: Thu Mar 23 10:27:09 2017 -0700

----------------------------------------------------------------------
 .../java/org/odpi/specs/runtime/hive/HiveHelper.java  | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bigtop/blob/a9be6752/bigtop-tests/spec-tests/runtime/src/test/java/org/odpi/specs/runtime/hive/HiveHelper.java
----------------------------------------------------------------------
diff --git a/bigtop-tests/spec-tests/runtime/src/test/java/org/odpi/specs/runtime/hive/HiveHelper.java b/bigtop-tests/spec-tests/runtime/src/test/java/org/odpi/specs/runtime/hive/HiveHelper.java
index 2ac9cc8..a4477ff 100644
--- a/bigtop-tests/spec-tests/runtime/src/test/java/org/odpi/specs/runtime/hive/HiveHelper.java
+++ b/bigtop-tests/spec-tests/runtime/src/test/java/org/odpi/specs/runtime/hive/HiveHelper.java
@@ -36,8 +36,7 @@ import org.apache.commons.logging.LogFactory;
 public class HiveHelper {
 	
 	private static final Log LOG = LogFactory.getLog(HiveHelper.class.getName());
-	
-	
+		
 	public static Map<String, String> execCommand(CommandLine commandline) {
 		
 		System.out.println("Executing command:");
@@ -48,6 +47,7 @@ public class HiveHelper {
 			env = EnvironmentUtils.getProcEnvironment();
 		} catch (IOException e1) {
 			// TODO Auto-generated catch block
+			LOG.debug("Failed to get process environment: "+ e1.getMessage());
 			e1.printStackTrace();
 		}
 
@@ -63,10 +63,20 @@ public class HiveHelper {
 			executor.execute(commandline, env, resultHandler);
 		} catch (ExecuteException e) {
 			// TODO Auto-generated catch block
+			LOG.debug("Failed to execute command with exit value: "+ String.valueOf(resultHandler.getExitValue()));
+			LOG.debug("outputStream: "+ outputStream.toString());
+			entry.put("exitValue", String.valueOf(resultHandler.getExitValue()));
+			entry.put("outputStream", outputStream.toString() + e.getMessage());
 			e.printStackTrace();
+			return entry;
 		} catch (IOException e) {
 			// TODO Auto-generated catch block
+			LOG.debug("Failed to execute command with exit value: "+ String.valueOf(resultHandler.getExitValue()));
+			LOG.debug("outputStream: "+ outputStream.toString());
+			entry.put("exitValue", String.valueOf(resultHandler.getExitValue()));
+			entry.put("outputStream", outputStream.toString() + e.getMessage());
 			e.printStackTrace();
+			return entry;
 		}
 		
 		try {