diff --git a/mapreduce/CHANGES.txt b/mapreduce/CHANGES.txt index ee6fba9e05c..1188ee677af 100644 --- a/mapreduce/CHANGES.txt +++ b/mapreduce/CHANGES.txt @@ -37,6 +37,8 @@ Trunk (unreleased changes) IMPROVEMENTS + MAPREDUCE-2679. Minor changes to sync trunk with MR-279 branch. (acmurthy) + MAPREDUCE-2400. Remove Cluster's dependency on JobTracker via a ServiceProvider for the actual implementation. (tomwhite via acmurthy) diff --git a/mapreduce/src/java/org/apache/hadoop/mapred/JobACLsManager.java b/mapreduce/src/java/org/apache/hadoop/mapred/JobACLsManager.java index 56dd1a28952..9e9ad1ea99e 100644 --- a/mapreduce/src/java/org/apache/hadoop/mapred/JobACLsManager.java +++ b/mapreduce/src/java/org/apache/hadoop/mapred/JobACLsManager.java @@ -21,6 +21,7 @@ import java.util.HashMap; import java.util.Map; import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.mapreduce.JobACL; import org.apache.hadoop.mapreduce.MRConfig; import org.apache.hadoop.security.AccessControlException; @@ -30,9 +31,9 @@ import org.apache.hadoop.security.authorize.AccessControlList; @InterfaceAudience.Private class JobACLsManager { - JobConf conf; + Configuration conf; - public JobACLsManager(JobConf conf) { + public JobACLsManager(Configuration conf) { this.conf = conf; } @@ -47,7 +48,7 @@ class JobACLsManager { * * @return JobACL to AccessControlList map. */ - Map constructJobACLs(JobConf conf) { + Map constructJobACLs(Configuration conf) { Map acls = new HashMap(); diff --git a/mapreduce/src/java/org/apache/hadoop/mapred/JobContextImpl.java b/mapreduce/src/java/org/apache/hadoop/mapred/JobContextImpl.java index f5e2ac86c5d..8e188903b7d 100644 --- a/mapreduce/src/java/org/apache/hadoop/mapred/JobContextImpl.java +++ b/mapreduce/src/java/org/apache/hadoop/mapred/JobContextImpl.java @@ -33,14 +33,14 @@ public class JobContextImpl private JobConf job; private Progressable progress; - JobContextImpl(JobConf conf, org.apache.hadoop.mapreduce.JobID jobId, + public JobContextImpl(JobConf conf, org.apache.hadoop.mapreduce.JobID jobId, Progressable progress) { super(conf, jobId); this.job = conf; this.progress = progress; } - JobContextImpl(JobConf conf, org.apache.hadoop.mapreduce.JobID jobId) { + public JobContextImpl(JobConf conf, org.apache.hadoop.mapreduce.JobID jobId) { this(conf, jobId, Reporter.NULL); } diff --git a/mapreduce/src/java/org/apache/hadoop/mapred/TaskAttemptContextImpl.java b/mapreduce/src/java/org/apache/hadoop/mapred/TaskAttemptContextImpl.java index 4e064b769c0..e278a8bfc99 100644 --- a/mapreduce/src/java/org/apache/hadoop/mapred/TaskAttemptContextImpl.java +++ b/mapreduce/src/java/org/apache/hadoop/mapred/TaskAttemptContextImpl.java @@ -34,7 +34,7 @@ public class TaskAttemptContextImpl implements TaskAttemptContext { private Reporter reporter; - TaskAttemptContextImpl(JobConf conf, TaskAttemptID taskid) { + public TaskAttemptContextImpl(JobConf conf, TaskAttemptID taskid) { this(conf, taskid, Reporter.NULL); } diff --git a/mapreduce/src/java/org/apache/hadoop/mapreduce/Job.java b/mapreduce/src/java/org/apache/hadoop/mapreduce/Job.java index 1011fe61bdd..0be084077d4 100644 --- a/mapreduce/src/java/org/apache/hadoop/mapreduce/Job.java +++ b/mapreduce/src/java/org/apache/hadoop/mapreduce/Job.java @@ -1113,13 +1113,17 @@ public class Job extends JobContextImpl implements JobContext { eventCounter += events.length; printTaskEvents(events, filter, profiling, mapRanges, reduceRanges); } + boolean success = isSuccessful(); + if (success) { + LOG.info("Job " + jobId + " completed successfully"); + } else { + LOG.info("Job " + jobId + " failed with state " + status.getState()); + } Counters counters = getCounters(); if (counters != null) { LOG.info(counters.toString()); } - LOG.info("Job " + jobId + " completed with status: " - + getStatus().getState()); - return isSuccessful(); + return success; } /** diff --git a/mapreduce/src/java/org/apache/hadoop/mapreduce/jobhistory/EventWriter.java b/mapreduce/src/java/org/apache/hadoop/mapreduce/jobhistory/EventWriter.java index 2b7299fc661..400bcb28374 100644 --- a/mapreduce/src/java/org/apache/hadoop/mapreduce/jobhistory/EventWriter.java +++ b/mapreduce/src/java/org/apache/hadoop/mapreduce/jobhistory/EventWriter.java @@ -66,8 +66,9 @@ class EventWriter { out.writeBytes("\n"); } - void flush() throws IOException { + void flush() throws IOException { encoder.flush(); + out.flush(); } void close() throws IOException {