[jboss-jira] [JBoss JIRA] (JGRP-1982) RequestCorrelator: use IntHashMap / LongHashmap for request correlation

Bela Ban (JIRA) issues at jboss.org
Fri Jan 8 03:45:00 EST 2016


    [ https://issues.jboss.org/browse/JGRP-1982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13146097#comment-13146097 ] 

Bela Ban commented on JGRP-1982:
--------------------------------

Turns out that compaction 'in the middle' doesn't work with the current design. If we have

||0||1||2||3||4||5||6||7||
|-|-|-|-|-|21|22|23|

where low=21 and high=24.

Compacting this yield:

||0||1||2||3||
|-|21|22|23|

(low=21, high=24)

However, growing the array again yields:

||0||1||2||3||4||5||6||7||
|-|21|22|23|-|-|-|-|

(low=21, high=24)

The problem here is that we hash a _seqno_ to an _index_, but once we've done this, we don't know what the actual seqno is, and hash on the indices only. E.g. indices for 21,22,23 and 5,6,7, then 1,2,3. The root issue is that a mod operation (hash) is not bijective, ie. {{21 % 8 = 5}}, but we cannot compute the original seqno 21 from 5.
We'd have to store the original seqno with the value, but that's too much overhead...

> RequestCorrelator: use IntHashMap / LongHashmap for request correlation
> -----------------------------------------------------------------------
>
>                 Key: JGRP-1982
>                 URL: https://issues.jboss.org/browse/JGRP-1982
>             Project: JGroups
>          Issue Type: Enhancement
>            Reporter: Bela Ban
>            Assignee: Bela Ban
>            Priority: Minor
>             Fix For: 3.6.7
>
>
> In RequestCorrelator (and possibly other classes), use an IntHashMap or LongHashmap for the request table. Goal: use less space when we have a lot of requests.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list