gavinchou commented on code in PR #33959:
URL: https://github.com/apache/doris/pull/33959#discussion_r1574306753
##########
be/src/io/hdfs_util.cpp:
##########
@@ -103,16 +103,16 @@ void HdfsHandlerCache::_clean_oldest() {
}
Status HdfsHandlerCache::get_connection(const THdfsParams& hdfs_params, const
std::string& fs_name,
- HdfsHandler** fs_handle) {
+ std::shared_ptr<HdfsHandler>*
fs_handle) {
uint64 hash_code = hdfs_hash_code(hdfs_params);
{
std::lock_guard<std::mutex> l(_lock);
auto it = _cache.find(hash_code);
if (it != _cache.end()) {
- HdfsHandler* handle = it->second.get();
+ std::shared_ptr<HdfsHandler> handle = it->second;
if (!handle->invalid()) {
handle->inc_ref();
- *fs_handle = handle;
+ *fs_handle = std::move(handle);
Review Comment:
why do we still have to deal with `inc_ref()` even with shared_ptr support?
can we integrate the process (inc_ref, dec_ref) into shared_ptr ?
--
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]