jsancio commented on a change in pull request #10497:
URL: https://github.com/apache/kafka/pull/10497#discussion_r608864999
##########
File path:
core/src/main/scala/kafka/server/metadata/BrokerMetadataListener.scala
##########
@@ -73,17 +77,25 @@ class BrokerMetadataListener(brokerId: Int,
/**
* Handle new metadata records.
*/
- override def handleCommits(lastOffset: Long, records:
util.List[ApiMessage]): Unit = {
- eventQueue.append(new HandleCommitsEvent(lastOffset, records))
+ override def handleCommit(reader: BatchReader[ApiMessageAndVersion]): Unit =
{
+ try {
+ while (reader.hasNext) {
+ val batch = reader.next()
Review comment:
The PR description states: "Update listeners to use BatchReader which
takes disk reads out of the Raft IO thread"
Doesn't this mean that the reading is happening on the thread that is
polling the `KafkaRaftClient`?
This comment also applies to the `QuorumMetaLogListener`.
##########
File path:
metadata/src/main/java/org/apache/kafka/controller/QuorumController.java
##########
@@ -557,9 +559,9 @@ public void run() throws Exception {
// out asynchronously.
final long offset;
if (result.isAtomic()) {
- offset = logManager.scheduleAtomicWrite(controllerEpoch,
result.records());
+ offset = raftClient.scheduleAtomicAppend(controllerEpoch,
result.records());
} else {
- offset = logManager.scheduleWrite(controllerEpoch,
result.records());
+ offset = raftClient.scheduleAppend(controllerEpoch,
result.records());
Review comment:
Should we file an Jira, if one doesn't already exists, to handle the
case of when this is `null`?
##########
File path: raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java
##########
@@ -2256,6 +2261,11 @@ private Long append(int epoch, List<T> records, boolean
isAtomic) {
return shutdownComplete;
}
+ @Override
+ public void resign(int epoch) {
+ throw new UnsupportedOperationException();
Review comment:
Would we implement this in this issue
https://issues.apache.org/jira/browse/KAFKA-12373? If so, let's update the
description of that issue to take this into account.
--
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:
[email protected]