Class BinlogHelper.FactoryImpl

    • 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)
      Returns s, 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 or null 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).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • 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 interface BinlogHelper.Factory
      • createBinaryLog

        @Nullable
        static BinlogHelper createBinaryLog​(BinaryLogSink sink,
                                            @Nullable
                                            java.lang.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 java.lang.String checkDigits​(java.lang.String s)
        Returns s, 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>/*.