Package org.apache.beam.sdk.coders
Class AtomicCoder<T>
java.lang.Object
org.apache.beam.sdk.coders.Coder<T>
org.apache.beam.sdk.coders.StructuredCoder<T>
org.apache.beam.sdk.coders.AtomicCoder<T>
- Type Parameters:
T
- the type of the values being transcoded
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AttributeValueCoder
,BigDecimalCoder
,BigEndianIntegerCoder
,BigEndianLongCoder
,BigEndianShortCoder
,BigIntegerCoder
,BigQueryInsertErrorCoder
,BigQueryStorageApiInsertErrorCoder
,BigtableWriteResultCoder
,BitSetCoder
,BooleanCoder
,ByteArrayCoder
,ByteCoder
,ByteStringCoder
,ByteStringCoder
,DefaultFilenamePolicy.ParamsCoder
,DoubleCoder
,DurationCoder
,ElasticsearchIO.DocumentCoder
,EncodedBoundedWindow.Coder
,FloatCoder
,InstantCoder
,IsmFormat.FooterCoder
,IsmFormat.IsmShardCoder
,IsmFormat.KeyPrefixCoder
,MetadataCoder
,MetadataCoderV2
,OffsetByteRangeCoder
,OffsetRange.Coder
,PaneInfo.PaneInfoCoder
,RandomAccessData.RandomAccessDataCoder
,ResourceIdCoder
,RowMutation.RowMutationCoder
,SplunkEventCoder
,StringUtf8Coder
,SubscriptionPartitionCoder
,TableDestinationCoder
,TableDestinationCoderV2
,TableDestinationCoderV3
,TableRowJsonCoder
,TextualIntegerCoder
,UuidCoder
,VarIntCoder
,VoidCoder
A
Coder
that has no component Coders
or other configuration.
Unless the behavior is overridden, atomic coders are presumed to be deterministic.
All atomic coders of the same class are considered to be equal to each other. As a result, an
AtomicCoder
should have no associated configuration (instance variables, etc).
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.beam.sdk.coders.Coder
Coder.Context, Coder.NonDeterministicException
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
.final int
hashCode()
.void
ThrowCoder.NonDeterministicException
if the coding is not deterministic.Methods inherited from class org.apache.beam.sdk.coders.StructuredCoder
toString
Methods inherited from class org.apache.beam.sdk.coders.Coder
consistentWithEquals, decode, decode, encode, encode, getEncodedElementByteSize, getEncodedElementByteSizeUsingCoder, getEncodedTypeDescriptor, isRegisterByteSizeObserverCheap, registerByteSizeObserver, structuralValue, verifyDeterministic, verifyDeterministic
-
Constructor Details
-
AtomicCoder
public AtomicCoder()
-
-
Method Details
-
verifyDeterministic
ThrowCoder.NonDeterministicException
if the coding is not deterministic.In order for a
Coder
to be considered deterministic, the following must be true:- two values that compare as equal (via
Object.equals()
orComparable.compareTo()
, if supported) have the same encoding. - the
Coder
always produces a canonical encoding, which is the same for an instance of an object even if produced on different computers at different times.
Unless overridden, does not throw. An
AtomicCoder
is presumed to be deterministic- Specified by:
verifyDeterministic
in classCoder<T>
- Throws:
Coder.NonDeterministicException
- if overridden to indicate that this subclass ofAtomicCoder
is not deterministic
- two values that compare as equal (via
-
getCoderArguments
If this is aCoder
for a parameterized type, returns the list ofCoder
s being used for each of the parameters in the same order they appear within the parameterized type's type signature. If this cannot be done, or thisCoder
does not encode/decode a parameterized type, returns the empty list..- Specified by:
getCoderArguments
in classCoder<T>
- Returns:
- the empty list
-
getComponents
Returns the list ofCoders
that are components of thisCoder
.The default components will be equal to the value returned by
Coder.getCoderArguments()
..- Overrides:
getComponents
in classStructuredCoder<T>
- Returns:
- the empty
List
.
-
equals
.- Overrides:
equals
in classStructuredCoder<T>
- Returns:
- true if the other object has the same class as this
AtomicCoder
.
-
hashCode
public final int hashCode().- Overrides:
hashCode
in classStructuredCoder<T>
- Returns:
- the
hashCode()
of theClass
of thisAtomicCoder
.
-