You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2021/12/29 15:34:58 UTC

[GitHub] [hbase] Apache9 commented on a change in pull request #3983: HBASE-26494 Using RefCnt to fix the flawed MemStoreLABImpl

Apache9 commented on a change in pull request #3983:
URL: https://github.com/apache/hbase/pull/3983#discussion_r776381687



##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ImmutableMemStoreLAB.java
##########
@@ -138,5 +138,16 @@ public boolean isOffHeap() {
     return ChunkCreator.getInstance().isOffheap();
   }
 
+  /**
+   * This method is only used for test.
+   */
+  public int getRefCntValue() {

Review comment:
       Please use RestrictedApi in error prone annotation, it will cause an compile error in our pre commit build if you have the annotation but someone breaks the rule.

##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ImmutableMemStoreLAB.java
##########
@@ -138,5 +138,16 @@ public boolean isOffHeap() {
     return ChunkCreator.getInstance().isOffheap();
   }
 
+  /**
+   * This method is only used for test.
+   */
+  public int getRefCntValue() {
+    return this.refCnt.refCnt();
+  }
+
+  boolean isClosed() {

Review comment:
       Only for test too?

##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreLABImpl.java
##########
@@ -264,33 +270,31 @@ public void close() {
     }
     // We could put back the chunks to pool for reusing only when there is no
     // opening scanner which will read their data
-    int count  = openScannerCount.get();
-    if(count == 0) {
-      recycleChunks();
-    }
+    this.refCnt.release();
   }
 
-  int getOpenScannerCount() {
-    return this.openScannerCount.get();
+  /**
+   * This method is only used for test.
+   * @return
+   */
+  int getRefCntValue() {

Review comment:
       Use RestrictedApi. And also remove the empty `@return` block.




-- 
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: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org