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
相关推荐
许长安1 小时前
RPC 同步调用基本使用方法:基于官方 RouteGuide 示例
c++·经验分享·笔记·rpc
kyriewen111 小时前
WebAssembly:前端界的“外挂”,让C++代码在浏览器里跑起来
开发语言·前端·javascript·c++·单元测试·ecmascript
浅念-4 小时前
刷穿LeetCode:BFS 解决 Flood Fill 算法
数据结构·c++·算法·leetcode·职场和发展·bfs·宽度优先
楼田莉子6 小时前
Linux网络:NAT_代理
linux·运维·服务器·开发语言·c++·后端
南境十里·墨染春水6 小时前
C++日志 2——实现单线程日志系统
java·jvm·c++
zh_xuan6 小时前
api测试工具添加历史记录功能
c++·libcurl·duilib
休息一下接着来6 小时前
C++ 固定容量环形队列实现
c++·算法
wxin_VXbishe8 小时前
springboot新能源车充电站管理系统小程序-计算机毕业设计源码29213
java·c++·spring boot·python·spring·django·php
05候补工程师9 小时前
【408 从零到一】线性表逻辑特征、存储结构对比与 C/C++ 动态内存分配避坑指南
c语言·开发语言·数据结构·c++·考研
怕什么真理无穷10 小时前
C++面试5_ TCP 粘包2(工业级)
开发语言·c++·tcp/ip