hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r548489 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/TaskRunner.java
Date Mon, 18 Jun 2007 20:54:38 GMT
Author: cutting
Date: Mon Jun 18 13:54:37 2007
New Revision: 548489

URL: http://svn.apache.org/viewvc?view=rev&rev=548489
Log:
HADOOP-1493.  Permit specification of 'java.library.path' system property in 'mapred.child.java.opts'
configuration property.  Contributed by Enis.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskRunner.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=548489&r1=548488&r2=548489
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Mon Jun 18 13:54:37 2007
@@ -156,6 +156,10 @@
  49. HADOOP-1459.  Fix so that, in HDFS, getFileCacheHints() returns
      hostnames instead of IP addresses.  (Dhruba Borthakur via cutting)
 
+ 50. HADOOP-1493.  Permit specification of "java.library.path" system
+     property in "mapred.child.java.opts" configuration property.
+     (Enis Soztutar via cutting)
+
 
 Release 0.13.0 - 2007-06-08
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskRunner.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskRunner.java?view=diff&rev=548489&r1=548488&r2=548489
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskRunner.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskRunner.java Mon Jun 18 13:54:37
2007
@@ -257,10 +257,24 @@
         int port = conf.getInt("mapred.task.tracker.report.port", 50050) + 1;
         javaOpts = replaceAll(javaOpts, "@port@", Integer.toString(port));
         String [] javaOptsSplit = javaOpts.split(" ");
+        //Add java.library.path; necessary for native-hadoop libraries
+        String libraryPath = System.getProperty("java.library.path");
+        if (libraryPath != null) {
+          boolean hasLibrary = false;
+          for(int i=0; i<javaOptsSplit.length ;i++) { 
+            if(javaOptsSplit[i].startsWith("-Djava.library.path=")) {
+              javaOptsSplit[i] += sep + libraryPath;
+              hasLibrary = true;
+              break;
+            }
+          }
+          if(!hasLibrary)
+            vargs.add("-Djava.library.path=" + libraryPath);
+        }
         for (int i = 0; i < javaOptsSplit.length; i++) {
           vargs.add(javaOptsSplit[i]);
         }
-
+        
         // Add classpath.
         vargs.add("-classpath");
         vargs.add(classPath.toString());
@@ -274,11 +288,7 @@
         vargs.add("-Dhadoop.tasklog.purgeLogSplits=" + conf.getBoolean("mapred.userlog.purgesplits",
true));
         vargs.add("-Dhadoop.tasklog.logsRetainHours=" + conf.getInt("mapred.userlog.retain.hours",
12)); 
 
-        // Add java.library.path; necessary for native-hadoop libraries
-        String libraryPath = System.getProperty("java.library.path");
-        if (libraryPath != null) {
-          vargs.add("-Djava.library.path=" + libraryPath);
-        }
+        
 
         // Add main class and its arguments 
         vargs.add(TaskTracker.Child.class.getName());  // main of Child



Mime
View raw message