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

ASF GitHub Bot commented on KAFKA-4851:
---------------------------------------

GitHub user dguy opened a pull request:

    https://github.com/apache/kafka/pull/2645

    KAFKA-4851: only search available segments during Segments.segments(from, 
to)

    restrict the locating of segments in {{Segments#segments(..)}} to only the 
segments that are currently available, i.e., rather than searching the hashmap 
for many segments that don't exist.

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

    $ git pull https://github.com/dguy/kafka session-windows-testing

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

    https://github.com/apache/kafka/pull/2645.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 #2645
    
----
commit fca1a2277fbb7020c42e4e028e8ec03bed3a8335
Author: Damian Guy <damian....@gmail.com>
Date:   2017-03-06T17:03:27Z

    only search available segments

----


> SessionStore.fetch(key) is a performance bottleneck
> ---------------------------------------------------
>
>                 Key: KAFKA-4851
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4851
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>    Affects Versions: 0.10.2.0
>            Reporter: Damian Guy
>            Assignee: Damian Guy
>             Fix For: 0.11.0.0
>
>
> When flushing the {{CachingSessionStore}} we need to search for the previous 
> value for a session. This involves searching each open RocksDB segment. The 
> code ends up doing a call  {{Segments.segments(0, Long.MAX_VALUE)}} this 
> results in approximately 3 million gets on a {{ConcurrentHashMap}} of which 
> all but 3 of them will be hits. 
> Change this code to restrict the segmentIds to search just to the available 
> set.



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

Reply via email to