github-actions[bot] commented on code in PR #61072:
URL: https://github.com/apache/doris/pull/61072#discussion_r2894324189


##########
be/src/vec/exec/scan/olap_scanner.cpp:
##########
@@ -692,25 +692,31 @@ void OlapScanner::update_realtime_counters() {
                 stats.compressed_bytes_read);
     } else {
         
_state->get_query_ctx()->resource_ctx()->io_context()->update_scan_bytes_from_local_storage(
-                stats.file_cache_stats.bytes_read_from_local - 
_bytes_read_from_local);
+                stats.file_cache_stats.bytes_read_from_local);
         _state->get_query_ctx()
                 ->resource_ctx()
                 ->io_context()
                 ->update_scan_bytes_from_remote_storage(
-                        stats.file_cache_stats.bytes_read_from_remote - 
_bytes_read_from_remote);
+                        stats.file_cache_stats.bytes_read_from_remote);
 
         DorisMetrics::instance()->query_scan_bytes_from_local->increment(
-                stats.file_cache_stats.bytes_read_from_local - 
_bytes_read_from_local);
+                stats.file_cache_stats.bytes_read_from_local);
         DorisMetrics::instance()->query_scan_bytes_from_remote->increment(
-                stats.file_cache_stats.bytes_read_from_remote - 
_bytes_read_from_remote);
+                stats.file_cache_stats.bytes_read_from_remote);
+    }
+
+    if (config::is_cloud_mode() && config::enable_file_cache) {
+        io::FileCacheProfileReporter 
cache_profile(local_state->_segment_profile.get());
+        cache_profile.update(&stats.file_cache_stats);
     }
 
     _tablet_reader->mutable_stats()->compressed_bytes_read = 0;
     _tablet_reader->mutable_stats()->uncompressed_bytes_read = 0;
     _tablet_reader->mutable_stats()->raw_rows_read = 0;
+    _tablet_reader->mutable_stats()->file_cache_stats = {};
 
-    _bytes_read_from_local = 
_tablet_reader->stats().file_cache_stats.bytes_read_from_local;
-    _bytes_read_from_remote = 
_tablet_reader->stats().file_cache_stats.bytes_read_from_remote;
+    _bytes_read_from_local = 0;

Review Comment:
   nit (dead code): After this PR, `_bytes_read_from_local` and 
`_bytes_read_from_remote` are effectively dead code — they are declared 
(initialized to 0 in `olap_scanner.h:106-107`), and only ever assigned 0 here. 
They are never read anywhere.
   
   Consider removing these two member variables from the header and these two 
assignment lines entirely. This would simplify the code and avoid future 
confusion about their purpose.



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