Преглед на файлове

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

James преди 9 години
родител
ревизия
3b6d57d5c0
променени са 1 файла, в които са добавени 1 реда и са изтрити 0 реда
  1. 1 0
      hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc

+ 1 - 0
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);