Search in sources :

Example 1 with RemotePartitionDeleteMetadata

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);
}
Also used : RemotePartitionDeleteMetadata(org.apache.kafka.server.log.remote.storage.RemotePartitionDeleteMetadata) Test(org.junit.jupiter.api.Test)

Example 2 with 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);
}
Also used : RemotePartitionDeleteMetadataTransform(org.apache.kafka.server.log.remote.metadata.storage.serialization.RemotePartitionDeleteMetadataTransform) ApiMessageAndVersion(org.apache.kafka.server.common.ApiMessageAndVersion) RemotePartitionDeleteMetadata(org.apache.kafka.server.log.remote.storage.RemotePartitionDeleteMetadata) Test(org.junit.jupiter.api.Test)

Example 3 with RemotePartitionDeleteMetadata

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());
}
Also used : TopicPartition(org.apache.kafka.common.TopicPartition) TopicIdPartition(org.apache.kafka.common.TopicIdPartition) RemotePartitionDeleteMetadata(org.apache.kafka.server.log.remote.storage.RemotePartitionDeleteMetadata) RemotePartitionDeleteMetadataRecord(org.apache.kafka.server.log.remote.metadata.storage.generated.RemotePartitionDeleteMetadataRecord)

Aggregations

RemotePartitionDeleteMetadata (org.apache.kafka.server.log.remote.storage.RemotePartitionDeleteMetadata)3 Test (org.junit.jupiter.api.Test)2 TopicIdPartition (org.apache.kafka.common.TopicIdPartition)1 TopicPartition (org.apache.kafka.common.TopicPartition)1 ApiMessageAndVersion (org.apache.kafka.server.common.ApiMessageAndVersion)1 RemotePartitionDeleteMetadataRecord (org.apache.kafka.server.log.remote.metadata.storage.generated.RemotePartitionDeleteMetadataRecord)1 RemotePartitionDeleteMetadataTransform (org.apache.kafka.server.log.remote.metadata.storage.serialization.RemotePartitionDeleteMetadataTransform)1