Enum Encoding

    • Enum Constant Detail

      • JSON

        public static final Encoding JSON
      • THRIFT

        @Deprecated
        public static final Encoding THRIFT
        Deprecated.
        this format is deprecated in favor of json or proto3
        The first format of Zipkin was TBinaryProtocol, big-endian thrift. It is no longer used, but defined here to allow collectors to support reading old data.

        The message's binary data includes a list header followed by N spans serialized in TBinaryProtocol

      • PROTO3

        public static final Encoding PROTO3
        Repeated (type 2) fields are length-prefixed. A list is a concatenation of fields with no additional overhead.

        See https://developers.google.com/protocol-buffers/docs/encoding#optional

    • Method Detail

      • values

        public static Encoding[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Encoding c : Encoding.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Encoding valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • encode

        public abstract byte[] encode​(List<byte[]> encodedSpans)
        Combines a list of encoded spans into an encoded list. For example, in THRIFT, this would be length-prefixed, whereas in JSON, this would be comma-separated and enclosed by brackets.

        The primary use of this is batch reporting spans. For example, spans are encoded one-by-one into a queue. This queue is drained up to a byte threshold. Then, the list is encoded with this function and reported out-of-process.

        Since:
        3.3
      • listSizeInBytes

        public abstract int listSizeInBytes​(int encodedSizeInBytes)
        Like listSizeInBytes(List), except for a single element.
      • listSizeInBytes

        public abstract int listSizeInBytes​(List<byte[]> values)
      • mediaType

        public abstract String mediaType()
        Returns this message's "Content-Type" for use in an HTTP sender targeting the Zipkin POST endpoint.
        Since:
        3.3