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

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

Branch: refs/heads/BIGTOP-1406
Commit: a1f26d353a055ea5ded408cb18f1521a3afc541e
Parents: b30dd42
Author: Raj Desai <[email protected]>
Authored: Thu Oct 27 10:31:24 2016 -0700
Committer: Roman Shaposhnik <[email protected]>
Committed: Fri Feb 24 12:03:45 2017 -0800

----------------------------------------------------------------------
 .../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/a1f26d35/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 {

Reply via email to