MAPREDUCE-1920. Enables completed jobstatus store by default. Contributed by Tom White

git-svn-id: https://svn.apache.org/repos/asf/hadoop/mapreduce/trunk@984641 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/CHANGES.txt b/CHANGES.txt
index 45371d1..ab61f0e 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -115,6 +115,9 @@
     MAPREDUCE-1523. Making Mumak work with Capacity-Scheduler (Anirban Das
     via mahadev)
 
+    MAPREDUCE-1920. Enables completed jobstatus store by default. (Tom White
+    via amareshwari)
+
   OPTIMIZATIONS
 
     MAPREDUCE-1354. Enhancements to JobTracker for better performance and
diff --git a/src/java/mapred-default.xml b/src/java/mapred-default.xml
index 54027ee..2db49b5 100644
--- a/src/java/mapred-default.xml
+++ b/src/java/mapred-default.xml
@@ -755,7 +755,7 @@
 
   <property>
     <name>mapreduce.jobtracker.persist.jobstatus.active</name>
-    <value>false</value>
+    <value>true</value>
     <description>Indicates if persistency of job status information is
       active or not.
     </description>
@@ -763,7 +763,7 @@
 
   <property>
   <name>mapreduce.jobtracker.persist.jobstatus.hours</name>
-  <value>0</value>
+  <value>1</value>
   <description>The number of hours job status information is persisted in DFS.
     The job status information will be available after it drops of the memory
     queue and between jobtracker restarts. With a zero value the job status
diff --git a/src/java/org/apache/hadoop/mapred/CompletedJobStatusStore.java b/src/java/org/apache/hadoop/mapred/CompletedJobStatusStore.java
index 56afdc6..dd34fac 100644
--- a/src/java/org/apache/hadoop/mapred/CompletedJobStatusStore.java
+++ b/src/java/org/apache/hadoop/mapred/CompletedJobStatusStore.java
@@ -65,11 +65,11 @@
   CompletedJobStatusStore(JobACLsManager aclsManager, Configuration conf)
       throws IOException {
     active =
-      conf.getBoolean(JTConfig.JT_PERSIST_JOBSTATUS, false);
+      conf.getBoolean(JTConfig.JT_PERSIST_JOBSTATUS, true);
 
     if (active) {
       retainTime =
-        conf.getInt(JTConfig.JT_PERSIST_JOBSTATUS_HOURS, 0) * HOUR;
+        conf.getInt(JTConfig.JT_PERSIST_JOBSTATUS_HOURS, 1) * HOUR;
 
       jobInfoDir =
         conf.get(JTConfig.JT_PERSIST_JOBSTATUS_DIR, JOB_INFO_STORE_DIR);
diff --git a/src/java/org/apache/hadoop/mapreduce/Job.java b/src/java/org/apache/hadoop/mapreduce/Job.java
index 2147efb..f2d2134 100644
--- a/src/java/org/apache/hadoop/mapreduce/Job.java
+++ b/src/java/org/apache/hadoop/mapreduce/Job.java
@@ -539,7 +539,8 @@
   }
 
   /**
-   * Gets the counters for this job.
+   * Gets the counters for this job. May return null if the job has been
+   * retired and the job is no longer in the completed job store.
    * 
    * @return the counters for this job.
    * @throws IOException
diff --git a/src/test/mapred-site.xml b/src/test/mapred-site.xml
index 53230eb..6773c40 100644
--- a/src/test/mapred-site.xml
+++ b/src/test/mapred-site.xml
@@ -44,4 +44,8 @@
   <name>mapred.child.java.opts</name>
   <value>-Xmx200m -Djava.net.preferIPv4Stack=true</value>
 </property>
+<property>
+  <name>mapreduce.jobtracker.persist.jobstatus.active</name>
+  <value>false</value>
+</property>
 </configuration>