Apache9 commented on code in PR #5906:
URL: https://github.com/apache/hbase/pull/5906#discussion_r1639785310


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/HalfStoreFileReader.java:
##########
@@ -349,4 +353,42 @@ public long getFilterEntries() {
     // Estimate the number of entries as half the original file; this may be 
wildly inaccurate.
     return super.getFilterEntries() / 2;
   }
+
+  /**
+   * Overrides close method to handle cache evictions for the referred file. 
If evictionOnClose is
+   * true, we will seek to the block containing the splitCell and evict all 
blocks from offset 0 up
+   * to that block offset if this is a bottom half reader, or the from the 
split block offset up to
+   * the end of the file if this is a top half reader.
+   * @param evictOnClose true if it should evict the file blocks from the 
cache.
+   */
+  @Override
+  public void close(boolean evictOnClose) throws IOException {
+    if (closed.compareAndSet(false, true)) {
+      if (evictOnClose && StoreFileInfo.isReference(this.reader.getPath())) {
+        final HFileReaderImpl.HFileScannerImpl s =

Review Comment:
   But there is a seekTo method in HFileScanner interface? I just mean why we 
need the cast 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]

Reply via email to