You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Biao Liu (JIRA)" <ji...@apache.org> on 2019/05/31 08:22:00 UTC

[jira] [Commented] (FLINK-12681) Provide an implementation of a thread-safe counter

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

Biao Liu commented on FLINK-12681:
----------------------------------

After taking a glance at the relevant codes, there is no need for other {{Metric}} types to provide a thread-safe implementation. Well it seems a tiny work.

> Provide an implementation of a thread-safe counter
> --------------------------------------------------
>
>                 Key: FLINK-12681
>                 URL: https://issues.apache.org/jira/browse/FLINK-12681
>             Project: Flink
>          Issue Type: Improvement
>            Reporter: Piyush Goyal
>            Assignee: Biao Liu
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> While adding metrics to Elasticsearch connector, we noticed that the SimpleCounter which seems like the main implementation of Counter interface is not thread-safe. It makes it tricky/expensive to use it in a multi-threaded context. 
> [~SleePy] mentioned that SimpleCounter is being used in many performance-sensitive code paths, so instead of changing it directly, we can provide a new thread-safe implementation of Counter.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)