You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/04/05 23:05:54 UTC
[GitHub] [kafka] dielhennr commented on a change in pull request #10480: KAFKA-12265: Move the BatchAccumulator in KafkaRaftClient to LeaderState
dielhennr commented on a change in pull request #10480:
URL: https://github.com/apache/kafka/pull/10480#discussion_r607383662
##########
File path: raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java
##########
@@ -2252,9 +2247,12 @@ public Long scheduleAtomicAppend(int epoch, List<T> records) {
return append(epoch, records, true);
}
+ @SuppressWarnings("unchecked")
private Long append(int epoch, List<T> records, boolean isAtomic) {
- BatchAccumulator<T> accumulator = this.accumulator;
- if (accumulator == null) {
+ BatchAccumulator<T> accumulator;
+ try {
+ accumulator = (BatchAccumulator<T>) quorum.leaderStateOrThrow().accumulator();
Review comment:
Removing the cast causes this...
`Type Mismatch: Cannot convert from BatchAccumulator<Object> to BatchAccumulator<T> `
even though this is the signature of accumulator()
`public BatchAccumulator<T> accumulator()`
--
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