Search in sources :

Example 1 with RemoteLogSegmentMetadataTransform

use of org.apache.kafka.server.log.remote.metadata.storage.serialization.RemoteLogSegmentMetadataTransform in project kafka by apache.

the class RemoteLogMetadataTransformTest method testRemoteLogSegmentMetadataTransform.

@Test
public void testRemoteLogSegmentMetadataTransform() {
    RemoteLogSegmentMetadataTransform metadataTransform = new RemoteLogSegmentMetadataTransform();
    RemoteLogSegmentMetadata metadata = createRemoteLogSegmentMetadata();
    ApiMessageAndVersion apiMessageAndVersion = metadataTransform.toApiMessageAndVersion(metadata);
    RemoteLogSegmentMetadata remoteLogSegmentMetadataFromRecord = metadataTransform.fromApiMessageAndVersion(apiMessageAndVersion);
    Assertions.assertEquals(metadata, remoteLogSegmentMetadataFromRecord);
}
Also used : RemoteLogSegmentMetadataTransform(org.apache.kafka.server.log.remote.metadata.storage.serialization.RemoteLogSegmentMetadataTransform) ApiMessageAndVersion(org.apache.kafka.server.common.ApiMessageAndVersion) RemoteLogSegmentMetadata(org.apache.kafka.server.log.remote.storage.RemoteLogSegmentMetadata) Test(org.junit.jupiter.api.Test)

Aggregations

ApiMessageAndVersion (org.apache.kafka.server.common.ApiMessageAndVersion)1 RemoteLogSegmentMetadataTransform (org.apache.kafka.server.log.remote.metadata.storage.serialization.RemoteLogSegmentMetadataTransform)1 RemoteLogSegmentMetadata (org.apache.kafka.server.log.remote.storage.RemoteLogSegmentMetadata)1 Test (org.junit.jupiter.api.Test)1