All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.trasier.client.impl.pubsub.PubSubConverter Maven / Gradle / Ivy

There is a newer version: 0.9.18
Show newest version
package com.trasier.client.impl.pubsub;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.trasier.client.model.Span;
import org.iq80.snappy.Snappy;

import java.io.IOException;

class PubSubConverter {

    private final ObjectMapper mapper;

    PubSubConverter() {
        this.mapper = new ObjectMapper();
    }

    byte[] compress(Span span) throws IOException {
        return Snappy.compress(mapper.writer().writeValueAsBytes(span));
    }

    byte[] getByteData(Span span) throws IOException {
        return mapper.writer().writeValueAsBytes(span);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy