hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject hadoop git commit: HDFS-12013: libhdfs++: read with offset at EOF should return 0 bytes instead of error. Contributed by Xiaowei Zhu
Date Fri, 07 Jul 2017 18:08:37 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HDFS-8707 0d2d073e2 -> 821f9717e


HDFS-12013: libhdfs++: read with offset at EOF should return 0 bytes instead of error.  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/821f9717
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/821f9717
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/821f9717

Branch: refs/heads/HDFS-8707
Commit: 821f9717ece8bbfe76807f08e0bdbbfdbab72549
Parents: 0d2d073
Author: James Clampffer <james.clampffer@hp.com>
Authored: Fri Jul 7 14:04:42 2017 -0400
Committer: James Clampffer <james.clampffer@hp.com>
Committed: Fri Jul 7 14:04:42 2017 -0400

----------------------------------------------------------------------
 .../src/main/native/libhdfspp/lib/fs/filehandle.cc              | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/821f9717/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filehandle.cc
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filehandle.cc
b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filehandle.cc
index eea7ac9..2087d53 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filehandle.cc
+++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filehandle.cc
@@ -181,7 +181,10 @@ void FileHandleImpl::AsyncPreadSome(
     return;
   }
 
-  if(offset >= file_info_->file_length_){
+  if(offset == file_info_->file_length_) {
+    handler(Status::OK(), "", 0);
+    return;
+  } else if(offset > file_info_->file_length_){
     handler(Status::InvalidOffset("AsyncPreadSome: trying to begin a read past the EOF"),
"", 0);
     return;
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message