Class TransportCompressionAttribute

java.lang.Object
io.deephaven.extensions.barrage.TransportCompressionAttribute

public final class TransportCompressionAttribute extends Object
Sets the Table.TRANSPORT_COMPRESSION_ATTRIBUTE of a table, rollup table or tree table, which allows the server to compress its Barrage snapshots and subscriptions, or removes it, so that the server's default compression types apply.
  • Method Details

    • withCompression

      public static <T extends AttributeMap<T>> T withCompression(@NotNull T grid, @NotNull @NotNull String... preference)
      Returns a copy of grid that allows the server to compress its Barrage snapshots and subscriptions with preference: the names of supported compression types, such as the built-in "zstd", "gzip", "snappy" and "deflate". Case and surrounding whitespace are ignored. The server uses the first type in preference that the client accepts, and sends uncompressed data when none match. Repeated types keep their first position. With no types, the result is never compressed, even when the server has default compression types; resetCompression(AttributeMap) returns to those instead.
      Parameters:
      grid - the table, rollup table or tree table to compress
      preference - the names of the compression types to allow, most preferred first
      Returns:
      a copy of grid with its Table.TRANSPORT_COMPRESSION_ATTRIBUTE set, to an empty list if preference is empty
      Throws:
      IllegalArgumentException - if a name is not a supported compression type
      NullPointerException - if preference or one of its names is null
    • withCompression

      public static <T extends AttributeMap<T>> T withCompression(@NotNull T grid, @NotNull @NotNull List<String> preference)
      Like withCompression(AttributeMap, String...), with the compression type names in a list.
      Parameters:
      grid - the table, rollup table or tree table to compress
      preference - the names of the compression types to allow, most preferred first
      Returns:
      a copy of grid with its Table.TRANSPORT_COMPRESSION_ATTRIBUTE set, to an empty list if preference is empty
      Throws:
      IllegalArgumentException - if a name is not a supported compression type
      NullPointerException - if preference or one of its names is null
    • resetCompression

      public static <T extends AttributeMap<T>> T resetCompression(@NotNull T grid)
      Returns a copy of grid without a Table.TRANSPORT_COMPRESSION_ATTRIBUTE, which undoes withCompression: the server compresses the result's Barrage snapshots and subscriptions with its default compression types, from the TransportCompression.defaultTypes property, and does not compress them when that property is unset.
      Parameters:
      grid - the table, rollup table or tree table
      Returns:
      a copy of grid without a Table.TRANSPORT_COMPRESSION_ATTRIBUTE