gavinchou commented on code in PR #68847:
URL: https://github.com/apache/doris/pull/68847#discussion_r4232872565


##########
be/src/io/file_factory.cpp:
##########
@@ -232,10 +231,12 @@ Result<io::FileReaderSPtr> 
FileFactory::_create_file_reader_internal(
                 system_properties.properties, s3_uri, &s3_conf));
         auto client_holder = 
std::make_shared<io::ObjClientHolder>(s3_conf.client_conf);
         RETURN_IF_ERROR_RESULT(client_holder->init());
+        auto options = reader_options;
+        options.fs_identity = s3_conf.client_conf.endpoint;
         return io::S3FileReader::create(std::move(client_holder), 
s3_conf.bucket, s3_uri.get_key(),
                                         file_description.file_size, profile)
-                .and_then([&](auto&& reader) {
-                    return io::create_cached_file_reader(std::move(reader), 
reader_options);
+                .and_then([&options](auto&& reader) {
+                    return io::create_cached_file_reader(std::move(reader), 
options);

Review Comment:
   what about add an option called `cache_key_function`, which is a lambda to 
define the the cache key instead of tricking CacheRemoteFileReader



##########
be/src/io/file_factory.cpp:
##########
@@ -232,10 +231,12 @@ Result<io::FileReaderSPtr> 
FileFactory::_create_file_reader_internal(
                 system_properties.properties, s3_uri, &s3_conf));
         auto client_holder = 
std::make_shared<io::ObjClientHolder>(s3_conf.client_conf);
         RETURN_IF_ERROR_RESULT(client_holder->init());
+        auto options = reader_options;
+        options.fs_identity = s3_conf.client_conf.endpoint;
         return io::S3FileReader::create(std::move(client_holder), 
s3_conf.bucket, s3_uri.get_key(),
                                         file_description.file_size, profile)
-                .and_then([&](auto&& reader) {
-                    return io::create_cached_file_reader(std::move(reader), 
reader_options);
+                .and_then([&options](auto&& reader) {
+                    return io::create_cached_file_reader(std::move(reader), 
options);

Review Comment:
   what about adding an option called `cache_key_function`, which is a lambda 
to define the the cache key instead of tricking CacheRemoteFileReader



-- 
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]

Reply via email to