kafka-jira mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [kafka] aloknnikhil commented on a change in pull request #9881: Initialize QuorumState lazily in RaftClient.initialize()
Date Thu, 14 Jan 2021 03:05:55 GMT

aloknnikhil commented on a change in pull request #9881:
URL: https://github.com/apache/kafka/pull/9881#discussion_r557014621



##########
File path: raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java
##########
@@ -325,8 +341,30 @@ private void fireHandleResign() {
     }
 
     @Override
-    public void initialize() throws IOException {
-        quorum.initialize(new OffsetAndEpoch(log.endOffset().offset, log.lastFetchedEpoch()));
+    public void initialize(String quorumVoterStrings) throws IOException {

Review comment:
       I had the same idea as @jsancio. I think it makes sense to store a reference to RaftConfig
locally and access these parameters on-demand. And caching these in private fields on construction
of the RaftConfig makes sense to me. That would prevent the `Map.get` on every access.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message