This is an automated email from the ASF dual-hosted git repository.

kturner pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/master by this push:
     new 58dca69  update row lock comments #1364 (#1380)
58dca69 is described below

commit 58dca69eeaae98a70384d9bcd8f34966b031fef5
Author: Keith Turner <ktur...@apache.org>
AuthorDate: Wed Oct 2 16:06:57 2019 -0400

    update row lock comments #1364 (#1380)
---
 .../tserver/src/main/java/org/apache/accumulo/tserver/RowLocks.java   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/RowLocks.java 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/RowLocks.java
index 46aa253..10885ea 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/RowLocks.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/RowLocks.java
@@ -34,6 +34,10 @@ import com.google.common.base.Preconditions;
 
 class RowLocks {
 
+  // The compute function in Concurrent Hash Map supports atomic execution of 
the remapping function
+  // and will only execute it once. Properly computing the reference counts 
relies on this specific
+  // behavior. Not all concurrent map implementations have the desired 
behavior. For example
+  // ConcurrentSkipListMap.compute is not atomic and may execute the function 
multiple times.
   private final Map<ByteSequence,RowLock> rowLocks = new ConcurrentHashMap<>();
 
   static class RowLock {

Reply via email to