wchevreuil commented on a change in pull request #764: HBASE-23223 Support the 
offsetLock of bucketCache to use strong ref
URL: https://github.com/apache/hbase/pull/764#discussion_r339527832
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/util/IdReadWriteLock.java
 ##########
 @@ -42,93 +21,7 @@
  * For write lock, use lock.writeLock()
  */
 @InterfaceAudience.Private
-public class IdReadWriteLock<T> {
-  // The number of lock we want to easily support. It's not a maximum.
-  private static final int NB_CONCURRENT_LOCKS = 1000;
-  /**
-   * The pool to get entry from, entries are mapped by {@link Reference} and 
will be automatically
-   * garbage-collected by JVM
-   */
-  private final ObjectPool<T, ReentrantReadWriteLock> lockPool;
-  private final ReferenceType refType;
-
-  public IdReadWriteLock() {
-    this(ReferenceType.WEAK);
-  }
-
-  /**
-   * Constructor of IdReadWriteLock
-   * @param referenceType type of the reference used in lock pool, {@link 
ReferenceType#WEAK} by
-   *          default. Use {@link ReferenceType#SOFT} if the key set is 
limited and the locks will
-   *          be reused with a high frequency
-   */
-  public IdReadWriteLock(ReferenceType referenceType) {
-    this.refType = referenceType;
-    switch (referenceType) {
 
 Review comment:
   Why not just add a third, _STRONG_ reference type option, then implement 
your *IdReadWriteLockStrongRef* as a subclass of _ObjectPool_ ? That would keep 
reusing much of the current _locking_ logic, then.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to