[ 
https://issues.apache.org/jira/browse/HBASE-14279?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14993241#comment-14993241
 ] 

Hiroshi Ikeda commented on HBASE-14279:
---------------------------------------

{quote}
BucketCache will define sortedSet by itself, so we should pass the comparator 
into it.
{quote}

Oops, I overlooked... Is it important to be able to select between hash-set and 
sorted-set? Anyway concurrency/synchronized one just gives nothing but 
overhead, and at least it is required to rewrite the default factory.

{code}
   public Set<V> values(K key) {
...skip...
+      return ImmutableSet.copyOf(set);
+    }
   }
{code}

I think the caller would expect the returned object is created by the given 
value factory, and some methods might have different behaviors from the 
immutable set, especially if the caller gives a value factory which creates a 
sorted set (or a value comparator).

> Race condition in ConcurrentIndex
> ---------------------------------
>
>                 Key: HBASE-14279
>                 URL: https://issues.apache.org/jira/browse/HBASE-14279
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Hiroshi Ikeda
>            Assignee: Heng Chen
>            Priority: Minor
>         Attachments: HBASE-14279.patch, HBASE-14279_v2.patch, 
> HBASE-14279_v3.patch, HBASE-14279_v4.patch, LockStripedBag.java
>
>
> {{ConcurrentIndex.put}} and {{remove}} are in race condition. It is possible 
> to remove a non-empty set, and to add a value to a removed set. Also 
> {{ConcurrentIndex.values}} is vague in sense that the returned set sometimes 
> trace the current state and sometimes doesn't.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to