You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/05/11 18:32:04 UTC

[jira] [Commented] (BOOKKEEPER-1066) Introduce GrowableArrayBlockingQueue

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

ASF GitHub Bot commented on BOOKKEEPER-1066:
--------------------------------------------

GitHub user merlimat opened a pull request:

    https://github.com/apache/bookkeeper/pull/153

    BOOKKEEPER-1066: Introduce GrowableArrayBlockingQueue

    In multiple places, (eg: journal, ordered executor, etc..), we are using `LinkedBlockingQueue` instances to pass objects between threads.
    
    The `LinkedBlockingQueue` differs from the `ArrayBlockingQueue` in that it doesn't require to define a max queue size, though, being implemented with a linked list, it requires to allocates list nodes each time an item is added.
    
    We can use a `GrowableArrayBlockingQueue` that behaves in the same way as the `LinkedBlockingQueue`, but it's implemented with an array that can be resized when the queue reaches the capacity.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/merlimat/bookkeeper growable-blocking-queue

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/bookkeeper/pull/153.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #153
    
----
commit e98cf0b9fa77b7b79fec791b295b45abb0a2b5d4
Author: Matteo Merli <mm...@apache.org>
Date:   2017-05-11T18:29:20Z

    BOOKKEEPER-1066: Introduce GrowableArrayBlockingQueue

----


> Introduce GrowableArrayBlockingQueue
> ------------------------------------
>
>                 Key: BOOKKEEPER-1066
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-1066
>             Project: Bookkeeper
>          Issue Type: Improvement
>            Reporter: Matteo Merli
>            Assignee: Matteo Merli
>            Priority: Minor
>             Fix For: 4.5.0
>
>
> In multiple places, (eg: journal, ordered executor, etc..), we are using {{LinkedBlockingQueue}} instances to pass objects between threads.
> The {{LinkedBlockingQueue}} differs from the {{ArrayBlockingQueue}} in that it doesn't require to define a max queue size, though, being implemented with a linked list, it requires to allocates list nodes each time an item is added.
> We can use a {{GrowableArrayBlockingQueue}} that behaves in the same way as the {{LinkedBlockingQueue}}, but it's implemented with an array that can be resized when the queue reaches the capacity.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)