yiguolei commented on code in PR #17261:
URL: https://github.com/apache/doris/pull/17261#discussion_r1120982764
##########
be/src/util/hdfs_storage_backend.cpp:
##########
@@ -206,19 +220,30 @@ Status HDFSStorageBackend::download(const std::string&
remote, const std::string
}
Status HDFSStorageBackend::direct_download(const std::string& remote,
std::string* content) {
- std::unique_ptr<HdfsFileReader> hdfs_reader(new
HdfsFileReader(_properties, remote, 0));
- RETURN_IF_ERROR(hdfs_reader->open());
+ std::shared_ptr<io::FileSystem> file_system;
+ io::FileReaderSPtr hdfs_reader = nullptr;
+ auto cache_policy = io::FileCachePolicy::NO_CACHE;
+ IOContext io_ctx;
+ if (config::enable_file_cache && io_ctx.enable_file_cache) {
+ cache_policy = io::FileCachePolicy::FILE_BLOCK_CACHE;
+ }
+ io::FileBlockCachePathPolicy file_block_cache;
+ io::FileReaderOptions reader_options(cache_policy, file_block_cache);
+ THdfsParams hdfs_params = parse_properties(_properties);
+ RETURN_IF_ERROR(FileFactory::create_hdfs_reader(hdfs_params, remote,
&file_system, &hdfs_reader,
+ reader_options, &io_ctx));
+
constexpr size_t buf_sz = 1024 * 1024;
char read_buf[buf_sz];
Review Comment:
same problem here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]