use of org.apache.kafka.common.TopicIdPartition in project kafka by apache.
the class RemotePartitionMetadataStore method handleRemotePartitionDeleteMetadata.
@Override
public void handleRemotePartitionDeleteMetadata(RemotePartitionDeleteMetadata remotePartitionDeleteMetadata) {
log.debug("Received partition delete state with: [{}]", remotePartitionDeleteMetadata);
TopicIdPartition topicIdPartition = remotePartitionDeleteMetadata.topicIdPartition();
idToPartitionDeleteMetadata.put(topicIdPartition, remotePartitionDeleteMetadata);
if (remotePartitionDeleteMetadata.state() == RemotePartitionDeleteState.DELETE_PARTITION_FINISHED) {
// remove the association for the partition.
idToRemoteLogMetadataCache.remove(topicIdPartition);
idToPartitionDeleteMetadata.remove(topicIdPartition);
}
}
use of org.apache.kafka.common.TopicIdPartition in project kafka by apache.
the class RemotePartitionDeleteMetadataTransform method fromApiMessageAndVersion.
public RemotePartitionDeleteMetadata fromApiMessageAndVersion(ApiMessageAndVersion apiMessageAndVersion) {
RemotePartitionDeleteMetadataRecord record = (RemotePartitionDeleteMetadataRecord) apiMessageAndVersion.message();
TopicIdPartition topicIdPartition = new TopicIdPartition(record.topicIdPartition().id(), new TopicPartition(record.topicIdPartition().name(), record.topicIdPartition().partition()));
return new RemotePartitionDeleteMetadata(topicIdPartition, RemotePartitionDeleteState.forId(record.remotePartitionDeleteState()), record.eventTimestampMs(), record.brokerId());
}
Aggregations