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

Sijie Guo commented on BOOKKEEPER-482:
--------------------------------------

{code}
    protected void readSubscriptions(ByteString topic,
                                     Callback<Map<ByteString, 
InMemorySubscriptionState>> cb, Object ctx) {
        // Since we backed up in-memory information on lostTopic, we can just 
return that back
        Map<ByteString, InMemorySubscriptionState> topicSubs = 
top2sub2seqBackup.remove(topic);
{code}

if #readSubscriptions is called twice, the second time would get nothing.

{code}
    protected void readSubscriptionData(ByteString topic,
            ByteString subscriberId, Callback<InMemorySubscriptionState> cb, 
Object ctx) {
        // Since we backed up in-memory information on lostTopic, we can just 
return that back
        InMemorySubscriptionState subState = 
top2sub2seqBackup.get(topic).remove(subscriberId);
{code}

same things as #readSubscriptions. And if readSubscripitonData first and 
readSubscriptions later, we got subscriptions w/o first read subscription data. 

I think for InMemorySubscriptionManager we need some kind of in memory store 
rather than just a backup map. What I am thinking, a better solution is to 
provide an in-memory metadata manager factory. Then InMemorySubscriptionManager 
is a special instance of MMSubscriptionManager with in-memory metadata manager 
factory. That would make things easy and clean.
                
> Precommit is reporting findbugs errors in trunk
> -----------------------------------------------
>
>                 Key: BOOKKEEPER-482
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-482
>             Project: Bookkeeper
>          Issue Type: Bug
>            Reporter: Ivan Kelly
>            Assignee: Ivan Kelly
>             Fix For: 4.2.0
>
>         Attachments: 
> 0004-BOOKKEEPER-482-fix-for-findbugs-warnings-in-trunk.patch
>
>
> Precommit is reporting findbugs warnings. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to