You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "dengziming (Jira)" <ji...@apache.org> on 2020/06/24 02:48:00 UTC

[jira] [Updated] (KAFKA-10195) Move offset management codes from ConsumerCoordinator to a new class

     [ https://issues.apache.org/jira/browse/KAFKA-10195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

dengziming updated KAFKA-10195:
-------------------------------
    Attachment: image-2020-06-24-10-47-44-733.png

> Move offset management codes from ConsumerCoordinator to a new class
> --------------------------------------------------------------------
>
>                 Key: KAFKA-10195
>                 URL: https://issues.apache.org/jira/browse/KAFKA-10195
>             Project: Kafka
>          Issue Type: Improvement
>          Components: clients, consumer
>            Reporter: dengziming
>            Assignee: dengziming
>            Priority: Minor
>         Attachments: image-2020-06-24-10-47-44-733.png
>
>
> ConsumerCoordinator has 2 main functions:
>  # partitions assignment
>  # offset management
> We are adding some new features in it, for example KAFKA-9657 add a field `throwOnFetchStableOffsetsUnsupported` which only used in offset management.
> And the 2 functions almost don't interact with each other, so it's not wise to put these code in one single class, can we try to move offset management code to a new class.
> For example, the below fields only used in offset management:
>  ```
> // can be move to another class directly
>  private final OffsetCommitCallback defaultOffsetCommitCallback;
>  private final ConsumerInterceptors<?, ?> interceptors;
>  private final AtomicInteger pendingAsyncCommits;
>  private final ConcurrentLinkedQueue<OffsetCommitCompletion> completedOffsetCommits;
>  private AtomicBoolean asyncCommitFenced;
>  private final boolean throwOnFetchStableOffsetsUnsupported;
>  private PendingCommittedOffsetRequest pendingCommittedOffsetRequest = null;
>  
> // used in `onJoinComplete` but can also be moved out.
> private final boolean autoCommitEnabled;
> private final int autoCommitIntervalMs;
> private Timer nextAutoCommitTimer;
>  ```
> so we can just create a new class `OffsetManageCoordinator` and move the related codes into it.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)