Forráskód Böngészése

HADOOP-2723. Fixed the check for checking whether to do user task
profiling. Contributed by Amareshwari Sri Ramadasu.


git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@616486 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 17 éve
szülő
commit
946a3ed695

+ 3 - 0
CHANGES.txt

@@ -601,6 +601,9 @@ Trunk (unreleased changes)
     for runningMapTasks/runningReduceTasks. (Amar Kamat and Arun Murthy 
     via ddas)
 
+    HADOOP-2723. Fixed the check for checking whether to do user task
+    profiling. (Amareshwari Sri Ramadasu via omalley)
+
 Release 0.15.3 - 2008-01-18
 
   BUG FIXES

+ 25 - 0
conf/hadoop-default.xml

@@ -933,6 +933,31 @@ creations/deletions), or "all".</description>
     </description>
   </property>
 
+  <property>
+    <name>mapred.task.profile</name>
+    <value>false</value>
+    <description>To set whether the system should collect profiler
+     information for some of the tasks in this job? The information is stored
+     in the the user log directory. The value is "true" if task profiling
+     is enabled.</description>
+  </property>
+
+  <property>
+    <name>mapred.task.profile.maps</name>
+    <value>0-2</value>
+    <description> To set the ranges of map tasks to profile.
+    mapred.task.profile has to be set to true for the value to be accounted.
+    </description>
+  </property>
+
+  <property>
+    <name>mapred.task.profile.reduces</name>
+    <value>0-2</value>
+    <description> To set the ranges of reduce tasks to profile.
+    mapred.task.profile has to be set to true for the value to be accounted.
+    </description>
+  </property>
+
 <!-- ipc properties -->
 
 <property>

+ 7 - 5
src/java/org/apache/hadoop/mapred/TaskRunner.java

@@ -336,11 +336,13 @@ abstract class TaskRunner extends Thread {
       vargs.add("-Dhadoop.tasklog.taskid=" + taskid);
       vargs.add("-Dhadoop.tasklog.totalLogFileSize=" + logSize);
 
-      if (conf.getProfileTaskRange(t.isMapTask()
-                                   ).isIncluded(t.getPartition())) {
-        File prof = TaskLog.getTaskLogFile(taskid, TaskLog.LogName.PROFILE);
-        vargs.add("-agentlib:hprof=cpu=samples,heap=sites,force=n,thread=y,"+
-                  "verbose=n,file="+prof.toString());
+      if (conf.getProfileEnabled()) {
+        if (conf.getProfileTaskRange(t.isMapTask()
+                                     ).isIncluded(t.getPartition())) {
+          File prof = TaskLog.getTaskLogFile(taskid, TaskLog.LogName.PROFILE);
+          vargs.add("-agentlib:hprof=cpu=samples,heap=sites,force=n,thread=y,"
+                     + "verbose=n,file=" + prof.toString());
+        }
       }
 
       // Add main class and its arguments