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

This commit is contained in:
James 2015-12-08 16:24:20 -05:00 committed by James Clampffer
parent d6a04cdbdd
commit 7cd98323ec
1 changed files with 6 additions and 2 deletions

View File

@ -218,7 +218,11 @@ tOffset hdfsTell(hdfsFS fs, hdfsFile file) {
} }
tSize hdfsRead(hdfsFS fs, hdfsFile file, void* buffer, tSize length) { 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, tSize hdfsPread(hdfsFS fs, hdfsFile file, tOffset position,