use of org.apache.kafka.server.log.remote.storage.RemotePartitionDeleteMetadata in project kafka by apache.
the class RemoteLogMetadataSerdeTest method testRemotePartitionDeleteMetadataSerde.
@Test
public void testRemotePartitionDeleteMetadataSerde() {
RemotePartitionDeleteMetadata remotePartitionDeleteMetadata = createRemotePartitionDeleteMetadata();
doTestRemoteLogMetadataSerde(remotePartitionDeleteMetadata);
}
use of org.apache.kafka.server.log.remote.storage.RemotePartitionDeleteMetadata in project kafka by apache.
the class RemoteLogMetadataTransformTest method testRemoteLogPartitionMetadataTransform.
@Test
public void testRemoteLogPartitionMetadataTransform() {
RemotePartitionDeleteMetadataTransform transform = new RemotePartitionDeleteMetadataTransform();
RemotePartitionDeleteMetadata partitionDeleteMetadata = new RemotePartitionDeleteMetadata(TP0, RemotePartitionDeleteState.DELETE_PARTITION_STARTED, time.milliseconds(), 1);
ApiMessageAndVersion apiMessageAndVersion = transform.toApiMessageAndVersion(partitionDeleteMetadata);
RemotePartitionDeleteMetadata partitionDeleteMetadataFromRecord = transform.fromApiMessageAndVersion(apiMessageAndVersion);
Assertions.assertEquals(partitionDeleteMetadata, partitionDeleteMetadataFromRecord);
}
use of org.apache.kafka.server.log.remote.storage.RemotePartitionDeleteMetadata 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