Interface CompressionCodecProvider

All Known Implementing Classes:
DeflateCodec.Provider, GzipCodecProvider, SnappyCodec.Provider, ZstdCodec.Provider

public interface CompressionCodecProvider
Supplies a compression type that Deephaven supports for gRPC messages. CompressionCodecs finds every implementation on the classpath with ServiceLoader the first time it is used, including the ones this module includes for zstd, gzip, snappy and deflate. To add a type, list the implementation in META-INF/services/io.deephaven.grpc.compression.CompressionCodecProvider, or annotate it with @AutoService(CompressionCodecProvider.class), and put its jar on the classpath of the server and of each Java client that should accept the type. The Java client then accepts it by default.

The codec's encoding name names the type in a table's TransportCompression attribute, in withCompression, and in gRPC's grpc-encoding and grpc-accept-encoding headers. It must be lower-case letters, digits, ., _, + and -, starting with a letter or digit, and must not be identity. Otherwise CompressionCodecs logs a warning and leaves the type out, as it does when codec() throws. A provider whose type has the name of a built-in type replaces the built-in type. When two other providers supply the same name, the provider whose class name sorts first is used, and a warning is logged.

The Jetty server both compresses responses and decodes client requests with every codec, so a decompressor must handle malformed input safely. The Netty server registers only gzip, and never uses a provided codec.

  • Method Summary

    Modifier and Type
    Method
    Description
    io.grpc.Codec
     
  • Method Details

    • codec

      io.grpc.Codec codec()
      Returns:
      the codec for this compression type; called once per process