[ 
https://issues.apache.org/jira/browse/HBASE-14331?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hiroshi Ikeda updated HBASE-14331:
----------------------------------
    Attachment: SemaphoreBasedBlockingQueue.java
                SemaphoreBasedLinkedBlockingQueue.java
                SemaphoreBasedPriorityBlockingQueue.java
                BlockingQueuesPerformanceTestApp.java

Added trial semaphore based blocking classes, and a performance test 
application.

Despite I said I doubted sticking to {{BlockingQueue}}, I tried to implement 
{{BlockingQueue}}. That is because the main logic around the call queue is just 
executing tasks with threads, and it seems preferable to replace it with 
{{ThreadPoolExecutor}}, which also accept only {{BlockingQueue}} as its task 
queue.

But some methods can be just unsupported (around the {{Iterator.remove}} 
method) though the contract of the implemented interfaces allows it, and the 
implemented classes cannot be used with {{ThreadPoolExecutor}}. :-(

> a single callQueue related improvements
> ---------------------------------------
>
>                 Key: HBASE-14331
>                 URL: https://issues.apache.org/jira/browse/HBASE-14331
>             Project: HBase
>          Issue Type: Improvement
>          Components: IPC/RPC, Performance
>            Reporter: Hiroshi Ikeda
>            Priority: Minor
>         Attachments: BlockingQueuesPerformanceTestApp.java, 
> CallQueuePerformanceTestApp.java, SemaphoreBasedBlockingQueue.java, 
> SemaphoreBasedLinkedBlockingQueue.java, 
> SemaphoreBasedPriorityBlockingQueue.java
>
>
> {{LinkedBlockingQueue}} well separates locks between the {{take}} method and 
> the {{put}} method, but not between takers, and not between putters. These 
> methods are implemented to take locks at the almost beginning of their logic. 
> HBASE-11355 introduces multiple call-queues to reduce such possible 
> congestion, but I doubt that it is required to stick to {{BlockingQueue}}.
> There are the other shortcomings of using {{BlockingQueue}}. When using 
> multiple queues, since {{BlockingQueue}} blocks threads it is required to 
> prepare enough threads for each queue. It is possible that there is a queue 
> starving for threads while there is another queue where threads are idle. 
> Even if you can tune parameters to avoid such situations, the tuning is not 
> so trivial.
> I suggest using a single {{ConcurrentLinkedQueue}} with {{Semaphore}}.



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

Reply via email to