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 TypeMethodDescriptionbooleanstatic CoderProviderprotected Parser<DynamicMessage> Get the memoizedParser, possibly initializing it lazily.inthashCode()static DynamicProtoCoderof(Descriptors.Descriptor protoMessageDescriptor) Returns aDynamicProtoCoderfor the Protocol BuffersDynamicMessagefor the givenDescriptors.Descriptor.static DynamicProtoCoderof(ProtoDomain domain, Descriptors.Descriptor protoMessageDescriptor) Returns aDynamicProtoCoderfor the Protocol BuffersDynamicMessagefor the givenDescriptors.Descriptor.static DynamicProtoCoderof(ProtoDomain domain, String messageName) Returns aDynamicProtoCoderfor the Protocol BuffersDynamicMessagefor the given message name in aProtoDomain.withExtensionsFrom(Iterable<Class<?>> moreExtensionHosts) Returns aDynamicProtoCoderlike 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, withExtensionsFromMethods inherited from class org.apache.beam.sdk.coders.CustomCoder
getCoderArgumentsMethods 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 aDynamicProtoCoderfor the Protocol BuffersDynamicMessagefor the givenDescriptors.Descriptor. -
of
public static DynamicProtoCoder of(ProtoDomain domain, Descriptors.Descriptor protoMessageDescriptor) Returns aDynamicProtoCoderfor the Protocol BuffersDynamicMessagefor 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 aDynamicProtoCoderfor the Protocol BuffersDynamicMessagefor 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 aDynamicProtoCoderlike 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:
withExtensionsFromin classProtoCoder<DynamicMessage>
-
equals
- Overrides:
equalsin classProtoCoder<DynamicMessage>
-
hashCode
public int hashCode()- Overrides:
hashCodein classProtoCoder<DynamicMessage>
-
getParser
Get the memoizedParser, possibly initializing it lazily.- Overrides:
getParserin classProtoCoder<DynamicMessage>
-
getCoderProvider
Returns aCoderProviderwhich uses theDynamicProtoCoderforproto messages.This method is invoked reflectively from
DefaultCoder.
-