public RemoteLogMetadata deserialize(byte[] data) {
        ApiMessageAndVersion apiMessageAndVersion = bytesApiMessageSerde.deserialize(data);

        short apiKey = apiMessageAndVersion.message().apiKey();
        if (apiKey == REMOTE_LOG_SEGMENT_METADATA_API_KEY) {
            return segmentTransform.fromApiMessageAndVersion(apiMessageAndVersion);
        } else if (apiKey == REMOTE_LOG_SEGMENT_METADATA_UPDATE_API_KEY) {
            return segmentUpdateTransform.fromApiMessageAndVersion(apiMessageAndVersion);
        } else if (apiKey == REMOTE_PARTITION_DELETE_API_KEY) {
            return partitionDeleteTransform.fromApiMessageAndVersion(apiMessageAndVersion);
        } else if (apiKey == REMOTE_LOG_SEGMENT_METADATA_SNAPSHOT_API_KEY) {
            return segmentSnapshotTransform.fromApiMessageAndVersion(apiMessageAndVersion);
        } else {
            throw new IllegalArgumentException("RemoteLogMetadataTransform for apikey: " + apiKey + " does not exist.");
        }

    }
This class provides serialization and deserialization for {@link RemoteLogMetadata}. This is the root serde
for the messages that are stored in internal remote log metadata topic.
storage/src/main/java/org/apache/kafka/server/log/remote/metadata/storage/serialization/RemoteLogMetadataSerde.java