Class DynamicProtoCoder
java.lang.Object
org.apache.beam.sdk.coders.Coder<DynamicMessage>
org.apache.beam.sdk.coders.CustomCoder<DynamicMessage>
org.apache.beam.sdk.extensions.protobuf.ProtoCoder<DynamicMessage>
org.apache.beam.sdk.extensions.protobuf.DynamicProtoCoder
- All Implemented Interfaces:
Serializable
A
Coder
using Google Protocol Buffers binary format. DynamicProtoCoder
supports
both Protocol Buffers syntax versions 2 and 3.
To learn more about Protocol Buffers, visit: https://developers.google.com/protocol-buffers
DynamicProtoCoder
is not registered in the global CoderRegistry
as the
descriptor is required to create the coder.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.beam.sdk.coders.Coder
Coder.Context, Coder.NonDeterministicException
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionboolean
static CoderProvider
protected Parser
<DynamicMessage> Get the memoizedParser
, possibly initializing it lazily.int
hashCode()
static DynamicProtoCoder
of
(Descriptors.Descriptor protoMessageDescriptor) Returns aDynamicProtoCoder
for the Protocol BuffersDynamicMessage
for the givenDescriptors.Descriptor
.static DynamicProtoCoder
of
(ProtoDomain domain, Descriptors.Descriptor protoMessageDescriptor) Returns aDynamicProtoCoder
for the Protocol BuffersDynamicMessage
for the givenDescriptors.Descriptor
.static DynamicProtoCoder
of
(ProtoDomain domain, String messageName) Returns aDynamicProtoCoder
for the Protocol BuffersDynamicMessage
for the given message name in aProtoDomain
.withExtensionsFrom
(Iterable<Class<?>> moreExtensionHosts) Returns aDynamicProtoCoder
like this one, but with the extensions from the given classes registered.Methods inherited from class org.apache.beam.sdk.extensions.protobuf.ProtoCoder
decode, decode, encode, encode, getEncodedTypeDescriptor, getExtensionHosts, getExtensionRegistry, getMessageType, of, of, verifyDeterministic, withExtensionsFrom
Methods inherited from class org.apache.beam.sdk.coders.CustomCoder
getCoderArguments
Methods inherited from class org.apache.beam.sdk.coders.Coder
consistentWithEquals, getEncodedElementByteSize, getEncodedElementByteSizeUsingCoder, isRegisterByteSizeObserverCheap, registerByteSizeObserver, structuralValue, verifyDeterministic, verifyDeterministic
-
Field Details
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
-
Method Details
-
of
Returns aDynamicProtoCoder
for the Protocol BuffersDynamicMessage
for the givenDescriptors.Descriptor
. -
of
public static DynamicProtoCoder of(ProtoDomain domain, Descriptors.Descriptor protoMessageDescriptor) Returns aDynamicProtoCoder
for the Protocol BuffersDynamicMessage
for the givenDescriptors.Descriptor
. The message descriptor should be part of the providedProtoDomain
, this will ensure object equality within messages from the same domain. -
of
Returns aDynamicProtoCoder
for the Protocol BuffersDynamicMessage
for the given message name in aProtoDomain
. The message descriptor should be part of the provided *ProtoDomain
, this will ensure object equality within messages from the same domain. -
withExtensionsFrom
Returns aDynamicProtoCoder
like this one, but with the extensions from the given classes registered.Each of the extension host classes must be an class automatically generated by the Protocol Buffers compiler,
protoc
, that contains messages.Does not modify this object.
- Overrides:
withExtensionsFrom
in classProtoCoder<DynamicMessage>
-
equals
- Overrides:
equals
in classProtoCoder<DynamicMessage>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classProtoCoder<DynamicMessage>
-
getParser
Get the memoizedParser
, possibly initializing it lazily.- Overrides:
getParser
in classProtoCoder<DynamicMessage>
-
getCoderProvider
Returns aCoderProvider
which uses theDynamicProtoCoder
forproto messages
.This method is invoked reflectively from
DefaultCoder
.
-