Package io.grpc.protobuf.services
Class BinaryLogProviderImpl
java.lang.Object
io.grpc.BinaryLog
io.grpc.protobuf.services.BinaryLogProvider
io.grpc.protobuf.services.BinaryLogProviderImpl
- All Implemented Interfaces:
Closeable
,AutoCloseable
The default implementation of a
BinaryLogProvider
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final AtomicLong
private final BinlogHelper.Factory
private final BinaryLogSink
Fields inherited from class io.grpc.protobuf.services.BinaryLogProvider
BYTEARRAY_MARSHALLER
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.BinaryLogProviderImpl
(BinaryLogSink sink, String configStr) Creates an instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
getClientInterceptor
(String fullMethodName, CallOptions callOptions) Returns aClientInterceptor
for binary logging.getServerInterceptor
(String fullMethodName) Returns aServerInterceptor
for binary logging.Methods inherited from class io.grpc.protobuf.services.BinaryLogProvider
wrapChannel, wrapMethodDefinition
-
Field Details
-
counter
-
factory
-
sink
-
-
Constructor Details
-
BinaryLogProviderImpl
- Throws:
IOException
-
BinaryLogProviderImpl
Deprecated.Deprecated and will be removed in a future version of gRPC.- Throws:
IOException
-
BinaryLogProviderImpl
Creates an instance.- Parameters:
sink
- ownership is transferred to this class.configStr
- config string to parse to determine logged methods and msg size limits.- Throws:
IOException
- if initialization failed.
-
-
Method Details
-
getServerInterceptor
Description copied from class:BinaryLogProvider
Returns aServerInterceptor
for binary logging. gRPC is free to cache the interceptor, so the interceptor must be reusable across calls. At runtime, the request and response marshallers are alwaysMarshaller<InputStream>
. Returnsnull
if this method is not binary logged.- Specified by:
getServerInterceptor
in classBinaryLogProvider
-
getClientInterceptor
@Nullable public ClientInterceptor getClientInterceptor(String fullMethodName, CallOptions callOptions) Description copied from class:BinaryLogProvider
Returns aClientInterceptor
for binary logging. gRPC is free to cache the interceptor, so the interceptor must be reusable across calls. At runtime, the request and response marshallers are alwaysMarshaller<InputStream>
. Returnsnull
if this method is not binary logged.- Specified by:
getClientInterceptor
in classBinaryLogProvider
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classBinaryLogProvider
- Throws:
IOException
-