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 2018/03/22 20:43:13 UTC

[27/50] [abbrv] hadoop git commit: HDFS-12013: libhdfs++: read with offset at EOF should return 0 bytes instead of error. Contributed by Xiaowei Zhu

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/ba8ca0bd
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/ba8ca0bd
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/ba8ca0bd

Branch: refs/heads/HDFS-8707
Commit: ba8ca0bd096532ef3ab6e13fbe23ccaa61d7376e
Parents: 5827aec
Author: James Clampffer <ja...@hp.com>
Authored: Fri Jul 7 14:04:42 2017 -0400
Committer: James Clampffer <ja...@hp.com>
Committed: Thu Mar 22 16:20:45 2018 -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/ba8ca0bd/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