Package io.deephaven.server.arrow
Class TransportCompression
java.lang.Object
io.deephaven.server.arrow.TransportCompression
Chooses the compression type for a Barrage response from the table's
allowed list, or the server's default list, and the compression types the client
accepts; and holds the compression types the server uses.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe compression types the server allows for aTableorHierarchicalTablethat does not setTable.TRANSPORT_COMPRESSION_ATTRIBUTE, as an ordered, comma-separated list in the attribute's format, such aszstd,snappy.Thesupportedtypes that the server's configuration disables, sorted by name.The compression types this server compresses responses and decompresses requests with, sorted by name: everysupportedtype whoseTransportCompression.<type>.enabledproperty the server's configuration does not set tofalse. -
Method Summary
Modifier and TypeMethodDescriptionapply(@NotNull io.grpc.stub.StreamObserver<?> responseObserver, @NotNull Set<String> accepted, @Nullable AttributeMap<?> attributes, @NotNull String logName) Sets the compression ofresponseObserverto the first type inattributes' allowed list that the client accepts and this server has a compressor for, using the server'sdefault listwhen the object does not set one or sets one that cannot be parsed.
-
Field Details
-
DEFAULT_TYPES_PROPERTY
The compression types the server allows for aTableorHierarchicalTablethat does not setTable.TRANSPORT_COMPRESSION_ATTRIBUTE, as an ordered, comma-separated list in the attribute's format, such aszstd,snappy. Unset by default, so such tables are never compressed. The server ignores a value it cannot parse, and logs a warning.- See Also:
-
ENABLED_TYPES
The compression types this server compresses responses and decompresses requests with, sorted by name: everysupportedtype whoseTransportCompression.<type>.enabledproperty the server's configuration does not set tofalse. The server's gRPC registries hold only these types. -
DISABLED_TYPES
Thesupportedtypes that the server's configuration disables, sorted by name. The server neither compresses nor decompresses with them, but tables may still name them, and the server then uses the next type on the table's list.
-
-
Method Details
-
apply
public static Optional<String> apply(@NotNull @NotNull io.grpc.stub.StreamObserver<?> responseObserver, @NotNull @NotNull Set<String> accepted, @Nullable @Nullable AttributeMap<?> attributes, @NotNull @NotNull String logName) Sets the compression ofresponseObserverto the first type inattributes' allowed list that the client accepts and this server has a compressor for, using the server'sdefault listwhen the object does not set one or sets one that cannot be parsed. Leaves the response uncompressed when the object has no attributes, nothing matches, or the observer cannot be compressed. Must be called before the first response message is sent.- Parameters:
responseObserver- the raw gRPC response observer for the callaccepted- the compression types the client accepts, fromClientAcceptCompressionInterceptorattributes- the attributes of the object being sent, ornullif it has nonelogName- a description of the object being sent, for log messages- Returns:
- the chosen compression type, or empty if the response is not compressed
-