Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import java.util.concurrent.ConcurrentHashMap
import com.yammer.metrics.core.Gauge
import kafka.common.OffsetAndMetadata
import kafka.coordinator.group.GroupMetadataManager.maybeConvertOffsetCommitError
import kafka.server.{LogAppendResult, ReplicaManager, RequestLocal}
import kafka.server.{ReplicaManager, RequestLocal}
import kafka.utils.CoreUtils.inLock
import kafka.utils.Implicits._
import kafka.utils._
Expand Down Expand Up @@ -377,14 +377,13 @@ class GroupMetadataManager(brokerId: Int,
}

private def createPutCacheCallback(isTxnOffsetCommit: Boolean,
group: GroupMetadata,
consumerId: String,
offsetMetadata: immutable.Map[TopicIdPartition, OffsetAndMetadata],
filteredOffsetMetadata: Map[TopicIdPartition, OffsetAndMetadata],
responseCallback: immutable.Map[TopicIdPartition, Errors] => Unit,
producerId: Long,
records: Map[TopicPartition, MemoryRecords],
preAppendErrors: Map[TopicPartition, LogAppendResult] = Map.empty): Map[TopicPartition, PartitionResponse] => Unit = {
group: GroupMetadata,
consumerId: String,
offsetMetadata: immutable.Map[TopicIdPartition, OffsetAndMetadata],
filteredOffsetMetadata: Map[TopicIdPartition, OffsetAndMetadata],
responseCallback: immutable.Map[TopicIdPartition, Errors] => Unit,
producerId: Long,
records: Map[TopicPartition, MemoryRecords]): Map[TopicPartition, PartitionResponse] => Unit = {
val offsetTopicPartition = new TopicPartition(Topic.GROUP_METADATA_TOPIC_NAME, partitionFor(group.groupId))
// set the callback function to insert offsets into cache after log append completed
def putCacheCallback(responseStatus: Map[TopicPartition, PartitionResponse]): Unit = {
Expand Down Expand Up @@ -435,8 +434,6 @@ class GroupMetadataManager(brokerId: Int,
val commitStatus = offsetMetadata.map { case (topicIdPartition, offsetAndMetadata) =>
if (!validateOffsetMetadataLength(offsetAndMetadata.metadata))
(topicIdPartition, Errors.OFFSET_METADATA_TOO_LARGE)
else if (preAppendErrors.contains(topicIdPartition.topicPartition))
(topicIdPartition, preAppendErrors(topicIdPartition.topicPartition).error)
else
(topicIdPartition, responseError)
}
Expand Down