Velox 之 libhdfs

./include/hdfs/hdfs.h

csharp 复制代码
  51 #ifndef O_RDONLY
  52 #define O_RDONLY 1
  53 #endif
  54
  55 #ifndef O_WRONLY
  56 #define O_WRONLY 2
  57 #endif
csharp 复制代码
419 hdfsFile LibHdfsShim::OpenFile(
420     hdfsFS fs,
421     const char* path,
422     int flags,
423     int bufferSize,
424     short replication,
425     tSize blocksize) { // NOLINT
426   return this->hdfsOpenFile(
427       fs, path, flags, bufferSize, replication, blocksize);
428 }
csharp 复制代码
446 tSize LibHdfsShim::Read(hdfsFS fs, hdfsFile file, void* buffer, tSize length) {
447   return this->hdfsRead(fs, file, buffer, length);
448 }

/work/gluten/ep/build-velox/build/velox_ep/velox/connectors/hive/storage_adapters/hdfs/HdfsReadFile.cpp:95

csharp 复制代码
 92   void preadInternal(uint64_t offset, uint64_t length, char* pos) const {
 93     checkFileReadParameters(offset, length);
 94     if (!file_->handle_) {
 95       file_->open(driver_, hdfsClient_, filePath_);
 96     }
 97     file_->seek(offset);
 98     uint64_t totalBytesRead = 0;
 99     while (totalBytesRead < length) {
100       auto bytesRead = file_->read(pos, length - totalBytesRead);
101       totalBytesRead += bytesRead;
102       pos += bytesRead;
103     }

/work/gluten/ep/build-velox/build/velox_ep/velox/connectors/hive/storage_adapters/hdfs/HdfsReadFile.cpp:38

csharp 复制代码
 34   void open(
 35       filesystems::arrow::io::internal::LibHdfsShim* driver,
 36       hdfsFS client,
 37       const std::string& path) {
 38     driver_ = driver;
 39     client_ = client;
 40     handle_ = driver->OpenFile(client, path.data(), O_RDONLY, 0, 0, 0);
 41     VELOX_CHECK_NOT_NULL(
 42         handle_,
 43         "Unable to open file {}. got error: {}",
 44         path,
 45         driver_->GetLastExceptionRootCause());
 46   }

/work/gluten/ep/build-velox/build/velox_ep/velox/external/hdfs/ArrowHdfsInternal.cpp:426

csharp 复制代码
419 hdfsFile LibHdfsShim::OpenFile(
420     hdfsFS fs,
421     const char* path,
422     int flags,
423     int bufferSize,
424     short replication,
425     tSize blocksize) { // NOLINT
426   return this->hdfsOpenFile(
427       fs, path, flags, bufferSize, replication, blocksize);
428 }
429
相关推荐
clint4563 天前
C++进阶(1)——前景提要
c++
夜悊3 天前
C++代码示例:进制数简单生成工具
c++
郝学胜_神的一滴3 天前
CMake 021: IF 条件判据详诠
c++·cmake
_wyt0013 天前
洛谷 B3930 [GESP202312 五级] 烹饪问题 题解
c++·gesp
玖玥拾4 天前
C/C++ 数据结构(七)栈、容器适配器
c语言·数据结构·c++··容器适配器
один but you4 天前
constexpr函数
c++
凡人叶枫4 天前
Effective C++ 条款41:了解隐式接口和编译期多态
java·开发语言·c++·effective c++
凡人叶枫4 天前
Effective C++ 条款42:了解 typename 的双重意义
java·linux·服务器·c++
小胖xiaopangss4 天前
BRpc使用
c++·rpc
-森屿安年-4 天前
63. 不同路径 II
c++·算法·动态规划