From 180ac8dc1d430d4db23092efbf3abc93b1678e09 Mon Sep 17 00:00:00 2001 From: Chris Nauroth Date: Thu, 12 Jun 2014 20:02:45 +0000 Subject: [PATCH] MAPREDUCE-5912. Task.calculateOutputSize does not handle Windows files after MAPREDUCE-5196. Contributed by Remus Rusanu. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1602282 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../src/main/java/org/apache/hadoop/mapred/Task.java | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 6e80de9ef5..9642050aae 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -77,6 +77,9 @@ Trunk (Unreleased) MAPREDUCE-5196. Add bookkeeping for managing checkpoints of task state. (Carlo Curino via cdouglas) + MAPREDUCE-5912. Task.calculateOutputSize does not handle Windows files after + MAPREDUCE-5196. (Remus Rusanu via cnauroth) + BUG FIXES MAPREDUCE-5714. Removed forceful JVM exit in shutDownJob. diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/Task.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/Task.java index 72cd41c9ea..4815f191f7 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/Task.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/Task.java @@ -1120,8 +1120,8 @@ private long calculateOutputSize() throws IOException { if (isMapTask() && conf.getNumReduceTasks() > 0) { try { Path mapOutput = mapOutputFile.getOutputFile(); - FileSystem fs = mapOutput.getFileSystem(conf); - return fs.getFileStatus(mapOutput).getLen(); + FileSystem localFS = FileSystem.getLocal(conf); + return localFS.getFileStatus(mapOutput).getLen(); } catch (IOException e) { LOG.warn ("Could not find output size " , e); }