sanjeet006py commented on code in PR #7136:
URL: https://github.com/apache/hbase/pull/7136#discussion_r2185116384


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionScannerImpl.java:
##########
@@ -145,7 +150,18 @@ private static boolean hasNonce(HRegion region, long 
nonce) {
     } finally {
       
region.smallestReadPointCalcLock.unlock(ReadPointCalculationLock.LockType.RECORDING_LOCK);
     }
+    boolean isScanMetricsEnabled = scan.isScanMetricsEnabled();
+    
ThreadLocalServerSideScanMetrics.setScanMetricsEnabled(isScanMetricsEnabled);
+    if (isScanMetricsEnabled) {
+      ThreadLocalServerSideScanMetrics.reset();
+    }
     initializeScanners(scan, additionalScanners);
+    if (isScanMetricsEnabled) {
+      bytesReadFromFs += 
ThreadLocalServerSideScanMetrics.getBytesReadFromFsAndReset();

Review Comment:
   > This corresponds to any bytes read for trailer and metadata, which will 
only happen if the file is being read the first time or if the cached 
information is ejected correct? 
   
   No, as part of init of RegionScanner we init the StoreScanner. Init of 
StoreScanner involves reading bloom filters and seeking on StoreFileScanners 
and memstore scanners to the start of first row in scan. Trailer and HFile 
metadata is already loaded by this as I see its loaded when HStore is created 
as part of region open or when its committed. 
   
   



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

Reply via email to