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
static final class BinlogHelper.FactoryImpl extends java.lang.Object implements BinlogHelper.Factory
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<java.lang.String>
blacklistedMethods
private BinlogHelper
globalLog
private java.util.Map<java.lang.String,BinlogHelper>
perMethodLogs
private java.util.Map<java.lang.String,BinlogHelper>
perServiceLogs
-
Constructor Summary
Constructors Constructor Description FactoryImpl(BinaryLogSink sink, java.lang.String configurationString)
Accepts a string in the format specified by the binary log spec.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static java.lang.String
checkDigits(java.lang.String s)
Returnss
, after verifying it contains only digits.(package private) static BinlogHelper
createBinaryLog(BinaryLogSink sink, java.lang.String logConfig)
Returns a binlog with the correct header and message limits ornull
if the input is malformed.BinlogHelper
getLog(java.lang.String fullMethodName)
Accepts a full method name and returns the log that should be used.(package private) static boolean
isServiceGlob(java.lang.String input)
Returns true if the input string is a glob of the form:<package-service>/*
.(package private) static int
optionalInt(java.lang.String s)
Parses the optional int of the form "" (max int) or ":123" (123).
-
-
-
Field Detail
-
globalLog
private final BinlogHelper globalLog
-
perServiceLogs
private final java.util.Map<java.lang.String,BinlogHelper> perServiceLogs
-
perMethodLogs
private final java.util.Map<java.lang.String,BinlogHelper> perMethodLogs
-
blacklistedMethods
private final java.util.Set<java.lang.String> blacklistedMethods
-
-
Constructor Detail
-
FactoryImpl
FactoryImpl(BinaryLogSink sink, java.lang.String configurationString)
Accepts a string in the format specified by the binary log spec.
-
-
Method Detail
-
getLog
public BinlogHelper getLog(java.lang.String fullMethodName)
Accepts a full method name and returns the log that should be used.- Specified by:
getLog
in interfaceBinlogHelper.Factory
-
createBinaryLog
@Nullable static BinlogHelper createBinaryLog(BinaryLogSink sink, @Nullable java.lang.String logConfig)
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
static java.lang.String checkDigits(java.lang.String s)
Returnss
, after verifying it contains only digits.
-
optionalInt
static int optionalInt(java.lang.String s)
Parses the optional int of the form "" (max int) or ":123" (123).
-
isServiceGlob
static boolean isServiceGlob(java.lang.String input)
Returns true if the input string is a glob of the form:<package-service>/*
.
-
-