Serializable, Comparable<BytesMessageEncoder>public enum BytesMessageEncoder extends Enum<BytesMessageEncoder>
| Enum Constant | Description |
|---|---|
JSON |
|
PROTO3 |
This function simply concatenates the byte arrays.
|
THRIFT |
Deprecated.
this format is deprecated in favor of json or proto3
|
| Modifier and Type | Method | Description |
|---|---|---|
abstract byte[] |
encode(List<byte[]> encodedSpans) |
Combines a list of encoded spans into an encoded list.
|
static BytesMessageEncoder |
forEncoding(zipkin2.codec.Encoding encoding) |
|
static BytesMessageEncoder |
valueOf(String name) |
Returns the enum constant of this type with the specified name.
|
static BytesMessageEncoder[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final BytesMessageEncoder JSON
@Deprecated public static final BytesMessageEncoder THRIFT
This writes the list header followed by a concatenation of the input.
Encoding.THRIFTpublic static final BytesMessageEncoder PROTO3
The list of byte arrays represents a repeated (type 2) field. As such, each byte array is expected to have a prefix of the field number, followed by the encoded length of the span, finally, the actual span bytes.
Encoding.PROTO3public static BytesMessageEncoder[] values()
for (BytesMessageEncoder c : BytesMessageEncoder.values()) System.out.println(c);
public static BytesMessageEncoder valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic abstract byte[] encode(List<byte[]> encodedSpans)
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.
public static BytesMessageEncoder forEncoding(zipkin2.codec.Encoding encoding)
Copyright © 2016–2018 OpenZipkin. All rights reserved.