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.ObjectObject for serializing and deserializingTagContexts 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 TagContextfromByteArray(byte[] bytes)Creates aTagContextfrom the given on-the-wire encoded representation.abstract byte[]toByteArray(TagContext tags)Serializes theTagContextinto the on-the-wire representation.
-
-
-
Method Detail
-
toByteArray
public abstract byte[] toByteArray(TagContext tags) throws TagContextSerializationException
Serializes theTagContextinto the on-the-wire representation.This method should be the inverse of
fromByteArray(byte[]).Tags that have aTagMetadatawithTagMetadata.TagTtl.NO_PROPAGATIONwill not be serialized.- Parameters:
tags- theTagContextto 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 aTagContextfrom 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
TagContextdeserialized 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
-
-