Search in sources :

Example 26 with PartitionRegistration

use of org.apache.kafka.metadata.PartitionRegistration in project kafka by apache.

the class TopicDelta method replay.

public void replay(PartitionChangeRecord record) {
    PartitionRegistration partition = partitionChanges.get(record.partitionId());
    if (partition == null) {
        partition = image.partitions().get(record.partitionId());
        if (partition == null) {
            throw new RuntimeException("Unable to find partition " + record.topicId() + ":" + record.partitionId());
        }
    }
    partitionChanges.put(record.partitionId(), partition.merge(record));
}
Also used : PartitionRegistration(org.apache.kafka.metadata.PartitionRegistration)

Aggregations

PartitionRegistration (org.apache.kafka.metadata.PartitionRegistration)26 Uuid (org.apache.kafka.common.Uuid)11 ApiMessageAndVersion (org.apache.kafka.server.common.ApiMessageAndVersion)10 Test (org.junit.jupiter.api.Test)10 ArrayList (java.util.ArrayList)6 HashMap (java.util.HashMap)6 TopicRecord (org.apache.kafka.common.metadata.TopicRecord)5 List (java.util.List)4 UnknownTopicOrPartitionException (org.apache.kafka.common.errors.UnknownTopicOrPartitionException)4 AlterIsrRequestData (org.apache.kafka.common.message.AlterIsrRequestData)4 AlterIsrResponseData (org.apache.kafka.common.message.AlterIsrResponseData)3 AlterPartitionReassignmentsRequestData (org.apache.kafka.common.message.AlterPartitionReassignmentsRequestData)3 ReassignableTopic (org.apache.kafka.common.message.AlterPartitionReassignmentsRequestData.ReassignableTopic)3 AlterPartitionReassignmentsResponseData (org.apache.kafka.common.message.AlterPartitionReassignmentsResponseData)3 CreatableTopicResult (org.apache.kafka.common.message.CreateTopicsResponseData.CreatableTopicResult)3 PartitionRecord (org.apache.kafka.common.metadata.PartitionRecord)3 ApiError (org.apache.kafka.common.requests.ApiError)3 TimelineInteger (org.apache.kafka.timeline.TimelineInteger)3 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)3 OptionalInt (java.util.OptionalInt)2