Package io.opencensus.tags.propagation
Class TagContextBinarySerializer
- java.lang.Object
-
- io.opencensus.tags.propagation.TagContextBinarySerializer
-
- Direct Known Subclasses:
NoopTags.NoopTagContextBinarySerializer
,TagContextBinarySerializerImpl
public abstract class TagContextBinarySerializer extends java.lang.Object
Object for serializing and deserializingTagContext
s with the binary format.See opencensus-specs for the specification of the cross-language binary serialization format.
- Since:
- 0.8
-
-
Constructor Summary
Constructors Constructor Description TagContextBinarySerializer()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract TagContext
fromByteArray(byte[] bytes)
Creates aTagContext
from the given on-the-wire encoded representation.abstract byte[]
toByteArray(TagContext tags)
Serializes theTagContext
into the on-the-wire representation.
-
-
-
Method Detail
-
toByteArray
public abstract byte[] toByteArray(TagContext tags) throws TagContextSerializationException
Serializes theTagContext
into the on-the-wire representation.This method should be the inverse of
fromByteArray(byte[])
.Tag
s that have aTagMetadata
withTagMetadata.TagTtl.NO_PROPAGATION
will not be serialized.- Parameters:
tags
- theTagContext
to serialize.- Returns:
- the on-the-wire representation of a
TagContext
. - Throws:
TagContextSerializationException
- if the result would be larger than the maximum allowed serialized size.- Since:
- 0.8
-
fromByteArray
public abstract TagContext fromByteArray(byte[] bytes) throws TagContextDeserializationException
Creates aTagContext
from the given on-the-wire encoded representation.This method should be the inverse of
toByteArray(io.opencensus.tags.TagContext)
.- Parameters:
bytes
- on-the-wire representation of aTagContext
.- Returns:
- a
TagContext
deserialized frombytes
. - Throws:
TagContextDeserializationException
- if there is a parse error, the input contains invalid tags, or the input is larger than the maximum allowed serialized size.- Since:
- 0.8
-
-