accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] keith-turner commented on a change in pull request #990: Avoid multiple threads loading same cache block
Date Wed, 27 Feb 2019 16:05:08 GMT
keith-turner commented on a change in pull request #990: Avoid multiple threads loading same
cache block
URL: https://github.com/apache/accumulo/pull/990#discussion_r260820198
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
 ##########
 @@ -728,4 +746,11 @@ private long memorySize() {
   public void shutdown() {
     this.scheduleThreadPool.shutdown();
   }
+
+  @Override
+  public Lock getLoadLock(String blockName) {
+    // Would rather use Guava Striped, but its @Beta
+    int index = (blockName.hashCode() & 0x7fffffff) % loadLocks.length;
 
 Review comment:
   The reason for the and is to drop the sign bit.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message