A - type for the left coder.B - type for the right coder.public final class PairCoder<A,B> extends org.apache.beam.sdk.coders.StructuredCoder<Pair<A,B>>
Pair. Reference: KvCoder in BEAM.| Modifier and Type | Method and Description |
|---|---|
boolean |
consistentWithEquals() |
Pair<A,B> |
decode(InputStream inStream) |
void |
encode(Pair<A,B> pair,
OutputStream outStream) |
List<? extends org.apache.beam.sdk.coders.Coder<?>> |
getCoderArguments() |
boolean |
isRegisterByteSizeObserverCheap(Pair<A,B> pair)
Returns whether both leftCoder and rightCoder are considered not expensive.
|
static <A,B> PairCoder<A,B> |
of(org.apache.beam.sdk.coders.Coder<A> leftCoder,
org.apache.beam.sdk.coders.Coder<B> rightCoder)
static initializer of the class.
|
void |
registerByteSizeObserver(Pair<A,B> pair,
org.apache.beam.sdk.util.common.ElementByteSizeObserver observer)
Notifies ElementByteSizeObserver about the byte size of the
encoded value using this coder.
|
Object |
structuralValue(Pair<A,B> pair) |
void |
verifyDeterministic() |
equals, getComponents, getEncodedTypeDescriptor, hashCode, toStringpublic static <A,B> PairCoder<A,B> of(org.apache.beam.sdk.coders.Coder<A> leftCoder, org.apache.beam.sdk.coders.Coder<B> rightCoder)
A - type of the left element.B - type of the right element.leftCoder - left coder.rightCoder - right coder.public void encode(Pair<A,B> pair, OutputStream outStream) throws IOException
encode in class org.apache.beam.sdk.coders.Coder<Pair<A,B>>IOExceptionpublic Pair<A,B> decode(InputStream inStream) throws IOException
decode in class org.apache.beam.sdk.coders.Coder<Pair<A,B>>IOExceptionpublic List<? extends org.apache.beam.sdk.coders.Coder<?>> getCoderArguments()
public void verifyDeterministic()
throws org.apache.beam.sdk.coders.Coder.NonDeterministicException
public boolean consistentWithEquals()
public boolean isRegisterByteSizeObserverCheap(Pair<A,B> pair)
Copyright © 2018. All rights reserved.