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
相关推荐
lclin_20201 天前
VS2010兼容|C++系统全能监控工具(彩色界面+日志带单位+完整版)
c++·windows·系统监控·vs2010·编程实战
paeamecium1 天前
【PAT甲级真题】- Cars on Campus (30)
数据结构·c++·算法·pat考试·pat
UrSpecial1 天前
从零实现C++轻量线程池
c++·线程池
chh5631 天前
C++--模版初阶
c语言·开发语言·c++·学习·算法
会编程的土豆1 天前
01背包与完全背包详解
开发语言·数据结构·c++·算法
hetao17338371 天前
2026-04-12~14 hetao1733837 的刷题记录
c++·算法
智者知已应修善业1 天前
【51单片机4位数循环小数位移数值位移】2023-6-9
c++·经验分享·笔记·算法·51单片机
王璐WL1 天前
【C++】string,vector和list对比
c++·list
不爱吃炸鸡柳1 天前
算法复杂度从入门到精通:时间与空间复杂度全解析
开发语言·c++·算法
拳里剑气1 天前
C++算法:二分查找
c++·算法·二分查找·学习方法