Java Code Examples for org.apache.pulsar.common.api.proto.PulsarApi#CompressionType

The following examples show how to use org.apache.pulsar.common.api.proto.PulsarApi#CompressionType . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CompressionCodecProvider.java    From pulsar with Apache License 2.0 6 votes vote down vote up
public static PulsarApi.CompressionType convertToWireProtocol(CompressionType compressionType) {
    switch (compressionType) {
    case NONE:
        return PulsarApi.CompressionType.NONE;
    case LZ4:
        return PulsarApi.CompressionType.LZ4;
    case ZLIB:
        return PulsarApi.CompressionType.ZLIB;
    case ZSTD:
        return PulsarApi.CompressionType.ZSTD;
    case SNAPPY:
        return PulsarApi.CompressionType.SNAPPY;

    default:
        throw new RuntimeException("Invalid compression type");
    }
}
 
Example 2
Source File: CompressionCodecProvider.java    From pulsar with Apache License 2.0 6 votes vote down vote up
public static CompressionType convertFromWireProtocol(PulsarApi.CompressionType compressionType) {
    switch (compressionType) {
    case NONE:
        return CompressionType.NONE;
    case LZ4:
        return CompressionType.LZ4;
    case ZLIB:
        return CompressionType.ZLIB;
    case ZSTD:
        return CompressionType.ZSTD;
    case SNAPPY:
        return CompressionType.SNAPPY;

    default:
        throw new RuntimeException("Invalid compression type");
    }
}
 
Example 3
Source File: CompressionCodecProvider.java    From pulsar with Apache License 2.0 4 votes vote down vote up
public static CompressionCodec getCompressionCodec(PulsarApi.CompressionType type) {
    return codecs.get(type);
}