Search in sources :

Example 1 with RemoteLogSegmentMetadataUpdateTransform

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

the class RemoteLogMetadataTransformTest method testRemoteLogSegmentMetadataUpdateTransform.

@Test
public void testRemoteLogSegmentMetadataUpdateTransform() {
    RemoteLogSegmentMetadataUpdateTransform metadataUpdateTransform = new RemoteLogSegmentMetadataUpdateTransform();
    RemoteLogSegmentMetadataUpdate metadataUpdate = new RemoteLogSegmentMetadataUpdate(new RemoteLogSegmentId(TP0, Uuid.randomUuid()), time.milliseconds(), RemoteLogSegmentState.COPY_SEGMENT_FINISHED, 1);
    ApiMessageAndVersion apiMessageAndVersion = metadataUpdateTransform.toApiMessageAndVersion(metadataUpdate);
    RemoteLogSegmentMetadataUpdate metadataUpdateFromRecord = metadataUpdateTransform.fromApiMessageAndVersion(apiMessageAndVersion);
    Assertions.assertEquals(metadataUpdate, metadataUpdateFromRecord);
}
Also used : RemoteLogSegmentMetadataUpdate(org.apache.kafka.server.log.remote.storage.RemoteLogSegmentMetadataUpdate) ApiMessageAndVersion(org.apache.kafka.server.common.ApiMessageAndVersion) RemoteLogSegmentMetadataUpdateTransform(org.apache.kafka.server.log.remote.metadata.storage.serialization.RemoteLogSegmentMetadataUpdateTransform) RemoteLogSegmentId(org.apache.kafka.server.log.remote.storage.RemoteLogSegmentId) Test(org.junit.jupiter.api.Test)

Aggregations

ApiMessageAndVersion (org.apache.kafka.server.common.ApiMessageAndVersion)1 RemoteLogSegmentMetadataUpdateTransform (org.apache.kafka.server.log.remote.metadata.storage.serialization.RemoteLogSegmentMetadataUpdateTransform)1 RemoteLogSegmentId (org.apache.kafka.server.log.remote.storage.RemoteLogSegmentId)1 RemoteLogSegmentMetadataUpdate (org.apache.kafka.server.log.remote.storage.RemoteLogSegmentMetadataUpdate)1 Test (org.junit.jupiter.api.Test)1