You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by jh...@apache.org on 2016/04/18 15:26:51 UTC

hadoop git commit: libhdfs++: File length doesn't always count the last block if it's being written to. Contributed by Xiaowei Zhu.

Repository: hadoop
Updated Branches:
  refs/heads/HDFS-8707 082860052 -> d8653c8dc


libhdfs++: File length doesn't always count the last block if it's being written to. Contributed by Xiaowei Zhu.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/d8653c8d
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/d8653c8d
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/d8653c8d

Branch: refs/heads/HDFS-8707
Commit: d8653c8dc2ab9847d531cf48d1cd4dd6b005c3ff
Parents: 0828600
Author: James <jh...@apache.org>
Authored: Mon Apr 18 09:25:53 2016 -0400
Committer: James <jh...@apache.org>
Committed: Mon Apr 18 09:25:53 2016 -0400

----------------------------------------------------------------------
 .../src/main/native/libhdfspp/lib/fs/filesystem.cc                  | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/d8653c8d/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc
index 569b479..8530ffa 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc
+++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc
@@ -104,6 +104,7 @@ void NameNodeOperations::GetBlockLocations(const std::string & path,
 
       if (locations.has_lastblock() && locations.lastblock().b().numbytes()) {
         file_info->blocks_.push_back(locations.lastblock());
+        file_info->file_length_ += locations.lastblock().b().numbytes();
       }
 
       handler(stat, file_info);