Package io.grpc.protobuf.services
Class BinlogHelper.FactoryImpl
java.lang.Object
io.grpc.protobuf.services.BinlogHelper.FactoryImpl
- All Implemented Interfaces:
BinlogHelper.Factory
- Enclosing class:
BinlogHelper
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BinlogHelper
private final Map
<String, BinlogHelper> private final Map
<String, BinlogHelper> -
Constructor Summary
ConstructorsConstructorDescriptionFactoryImpl
(BinaryLogSink sink, String configurationString) Accepts a string in the format specified by the binary log spec. -
Method Summary
Modifier and TypeMethodDescription(package private) static String
Returnss
, after verifying it contains only digits.(package private) static BinlogHelper
createBinaryLog
(BinaryLogSink sink, String logConfig) Returns a binlog with the correct header and message limits ornull
if the input is malformed.Accepts a full method name and returns the log that should be used.(package private) static boolean
isServiceGlob
(String input) Returns true if the input string is a glob of the form:<package-service>/*
.(package private) static int
Parses the optional int of the form "" (max int) or ":123" (123).
-
Field Details
-
globalLog
-
perServiceLogs
-
perMethodLogs
-
blacklistedMethods
-
-
Constructor Details
-
FactoryImpl
FactoryImpl(BinaryLogSink sink, String configurationString) Accepts a string in the format specified by the binary log spec.
-
-
Method Details
-
getLog
Accepts a full method name and returns the log that should be used.- Specified by:
getLog
in interfaceBinlogHelper.Factory
-
createBinaryLog
Returns a binlog with the correct header and message limits ornull
if the input is malformed. The input should be a string that is in one of these forms:{h(:\d+)?}, {m(:\d+)?}, {h(:\d+)?,m(:\d+)?}
If the
logConfig
is null, the returned binlog will have a limit of Integer.MAX_VALUE. -
checkDigits
Returnss
, after verifying it contains only digits. -
optionalInt
Parses the optional int of the form "" (max int) or ":123" (123). -
isServiceGlob
Returns true if the input string is a glob of the form:<package-service>/*
.
-