You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by kh...@apache.org on 2014/04/12 18:43:42 UTC

svn commit: r1586876 - in /hive/trunk/hcatalog: bin/templeton.cmd webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TrivialExecService.java

Author: khorgath
Date: Sat Apr 12 16:43:42 2014
New Revision: 1586876

URL: http://svn.apache.org/r1586876
Log:
HIVE-6035 : Windows: percentComplete returned by job status from WebHCat is null (Shanyu Zhao via Sushanth Sowmyan)

Modified:
    hive/trunk/hcatalog/bin/templeton.cmd
    hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TrivialExecService.java

Modified: hive/trunk/hcatalog/bin/templeton.cmd
URL: http://svn.apache.org/viewvc/hive/trunk/hcatalog/bin/templeton.cmd?rev=1586876&r1=1586875&r2=1586876&view=diff
==============================================================================
--- hive/trunk/hcatalog/bin/templeton.cmd (original)
+++ hive/trunk/hcatalog/bin/templeton.cmd Sat Apr 12 16:43:42 2014
@@ -22,23 +22,26 @@ setlocal enabledelayedexpansion
   if "%1" == "--service" (
     set service_entry=true
     shift
+    set templeton-service-name=%1
+    if not defined templeton-service-name (
+      goto print_usage
+    )
   )
 
   @rem Init hadoop env variables (CLASSPATH, HADOOP_OPTS, etc)
+  @rem deal with difference in the location of hadoop-config.cmd
   set HADOOP_OPTS=
-  call %HADOOP_HOME%\bin\hadoop-config.cmd
-
-  set templeton-service-name=%1
-
-  if not defined templeton-service-name (
-      goto print_usage
+  if exist %HADOOP_HOME%\libexec\hadoop-config.cmd (
+    call %HADOOP_HOME%\libexec\hadoop-config.cmd
+  ) else (
+    call %HADOOP_HOME%\bin\hadoop-config.cmd
   )
 
   @rem
   @rem Compute the classpath
   @rem
-  set TEMPLETON_CONF_DIR=%HCATALOG_HOME%\conf
-  set TEMPLETON_CLASSPATH=%TEMPLETON_CONF_DIR%;%HCATALOG_HOME%;%HCATALOG_HOME%\share\webhcat\svr
+  set WEBHCAT_CONF_DIR=%HCATALOG_HOME%\etc\webhcat
+  set TEMPLETON_CLASSPATH=%WEBHCAT_CONF_DIR%;%HCATALOG_HOME%;%HCATALOG_HOME%\share\webhcat\svr
 
   set TEMPLETON_CLASSPATH=!TEMPLETON_CLASSPATH!;%HCATALOG_HOME%\share\hcatalog\*
   set TEMPLETON_CLASSPATH=!TEMPLETON_CLASSPATH!;%HCATALOG_HOME%\share\webhcat\svr\*
@@ -55,7 +58,7 @@ setlocal enabledelayedexpansion
 
   if not defined TEMPLETON_LOG4J (
     @rem must be prefixed with file: otherwise config is not picked up
-    set TEMPLETON_LOG4J=file:%HCATALOG_HOME%\conf\webhcat-log4j.properties
+    set TEMPLETON_LOG4J=file:%WEBHCAT_CONF_DIR%\webhcat-log4j.properties
   )
   set TEMPLETON_OPTS=-Dtempleton.log.dir=%TEMPLETON_LOG_DIR% -Dlog4j.configuration=%TEMPLETON_LOG4J% %HADOOP_OPTS%
   set arguments=%JAVA_HEAP_MAX% %TEMPLETON_OPTS% -classpath %CLASSPATH% org.apache.hcatalog.templeton.Main
@@ -63,7 +66,7 @@ setlocal enabledelayedexpansion
   if defined service_entry (
     call :makeServiceXml %arguments%
   ) else (
-    goto print_usage
+    call %JAVA% %arguments%
   )
   
 goto :eof

Modified: hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TrivialExecService.java
URL: http://svn.apache.org/viewvc/hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TrivialExecService.java?rev=1586876&r1=1586875&r2=1586876&view=diff
==============================================================================
--- hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TrivialExecService.java (original)
+++ hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TrivialExecService.java Sat Apr 12 16:43:42 2014
@@ -20,6 +20,7 @@ package org.apache.hive.hcatalog.templet
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.fs.Path;
 
 import java.io.File;
 import java.io.IOException;
@@ -65,7 +66,7 @@ final class TrivialExecService {
     //TempletonControllerJob ensures that this file is in DistributedCache
     File log4jProps = new File(JobSubmissionConstants.CONTAINER_LOG4J_PROPS);
     hcopts = hcopts.replace("log4j.configuration=container-log4j.properties",
-            "log4j.configuration=file://" + log4jProps.getAbsolutePath());
+            "log4j.configuration=file://" + new Path(log4jProps.getAbsolutePath()).toUri().toString());
     //helps figure out what log4j is doing, but may confuse 
     //some jobs due to extra output to stdout
     //hcopts = hcopts + " -Dlog4j.debug=true";