Class ClientAcceptCompressionInterceptor

java.lang.Object
io.deephaven.server.arrow.ClientAcceptCompressionInterceptor
All Implemented Interfaces:
io.grpc.ServerInterceptor

@Singleton public class ClientAcceptCompressionInterceptor extends Object implements io.grpc.ServerInterceptor
Captures the compression types a client accepts, as listed in its grpc-accept-encoding header, so that Barrage handlers can pick a response compression once they know which table is being sent.

The value lives in the call's gRPC Context, which gRPC attaches only on the thread that handles the call. A handler that picks the compression on another thread captures Context.current() at entry and calls acceptedCompression() within it, for example with Context.run(Runnable).

  • Constructor Details

    • ClientAcceptCompressionInterceptor

      @Inject public ClientAcceptCompressionInterceptor()
  • Method Details

    • acceptedCompression

      public static Set<String> acceptedCompression()
      Returns:
      the compression types the current call's client accepts, or an empty set if it listed none or no call's Context is attached
    • interceptCall

      public <ReqT, RespT> io.grpc.ServerCall.Listener<ReqT> interceptCall(io.grpc.ServerCall<ReqT,RespT> call, io.grpc.Metadata headers, io.grpc.ServerCallHandler<ReqT,RespT> next)
      Specified by:
      interceptCall in interface io.grpc.ServerInterceptor