You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Tsz-wo Sze (Jira)" <ji...@apache.org> on 2021/11/29 13:53:00 UTC

[jira] [Commented] (RATIS-1447) Cleanup NettyClientStreamRpc#replies empty queue

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

Tsz-wo Sze commented on RATIS-1447:
-----------------------------------

542_review.patch: review suggestions.

> Cleanup NettyClientStreamRpc#replies empty queue
> ------------------------------------------------
>
>                 Key: RATIS-1447
>                 URL: https://issues.apache.org/jira/browse/RATIS-1447
>             Project: Ratis
>          Issue Type: Sub-task
>            Reporter: GuoHao
>            Assignee: GuoHao
>            Priority: Major
>         Attachments: 542_review.patch
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> org.apache.ratis.netty.client.NettyClientStreamRpc#replies
> {code:java}
> private final ConcurrentMap<ClientInvocationId, Queue<CompletableFuture<DataStreamReply>>> replies =
>       new ConcurrentHashMap<>();
> {code}
> When all data for a streamID has been sent, is it necessary to clear the queue from the map?
> I would implement a ExpiringMap. If you don't use it for a long time or Queue.size is 0, I delete it from the Map.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)