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 Object implements BinlogHelper.Factory
  • Field Details

  • Constructor Details

    • FactoryImpl

      FactoryImpl(BinaryLogSink sink, String configurationString)
      Accepts a string in the format specified by the binary log spec.
  • Method Details

    • getLog

      public BinlogHelper getLog(String fullMethodName)
      Accepts a full method name and returns the log that should be used.
      Specified by:
      getLog in interface BinlogHelper.Factory
    • createBinaryLog

      @Nullable static BinlogHelper createBinaryLog(BinaryLogSink sink, @Nullable String logConfig)
      Returns a binlog with the correct header and message limits or null 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 String checkDigits(String s)
      Returns s, after verifying it contains only digits.
    • optionalInt

      static int optionalInt(String s)
      Parses the optional int of the form "" (max int) or ":123" (123).
    • isServiceGlob

      static boolean isServiceGlob(String input)
      Returns true if the input string is a glob of the form: <package-service>/*.