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-9489. Enable CI infrastructure to use libhdfs++ hdfsRead. Contributed by Stephen Walkauskas.
Date Tue, 08 Dec 2015 21:25:12 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HDFS-8707 e1aa7e5c6 -> b69e424a6


HDFS-9489.  Enable CI infrastructure to use libhdfs++ hdfsRead.  Contributed by Stephen Walkauskas.


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

Branch: refs/heads/HDFS-8707
Commit: b69e424a6d6392a8fb7ea086edf77e5a89573062
Parents: e1aa7e5
Author: James <jhc@apache.org>
Authored: Tue Dec 8 16:24:20 2015 -0500
Committer: James <jhc@apache.org>
Committed: Tue Dec 8 16:24:20 2015 -0500

----------------------------------------------------------------------
 .../src/main/native/libhdfspp/tests/hdfs_shim.c              | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/b69e424a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/hdfs_shim.c
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/hdfs_shim.c
b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/hdfs_shim.c
index 3954440..2854047 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/hdfs_shim.c
+++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/hdfs_shim.c
@@ -110,7 +110,7 @@ hdfsFS hdfsBuilderConnect(struct hdfsBuilder *bld) {
       libhdfspp_hdfsDisconnect(ret->libhdfsppRep);
       free(ret);
       ret = NULL;
-	}
+    }
   }
   return ret;
 }
@@ -218,7 +218,11 @@ tOffset hdfsTell(hdfsFS fs, hdfsFile file) {
 }
 
 tSize hdfsRead(hdfsFS fs, hdfsFile file, void* buffer, tSize length) {
-  return libhdfs_hdfsRead(fs->libhdfsRep, file->libhdfsRep, buffer, length);
+  // Read to update stats.
+  tSize nRead = libhdfs_hdfsRead(fs->libhdfsRep, file->libhdfsRep, buffer, length);
+  // Clear to avoid false positives.
+  if (nRead > 0) memset(buffer, 0, nRead);
+  return libhdfspp_hdfsRead(fs->libhdfsppRep, file->libhdfsppRep, buffer, length);
 }
 
 tSize hdfsPread(hdfsFS fs, hdfsFile file, tOffset position,


Mime
View raw message