Package org.apache.nemo.common.coder
Class PairEncoderFactory<A extends java.io.Serializable,B extends java.io.Serializable>
- java.lang.Object
-
- org.apache.nemo.common.coder.PairEncoderFactory<A,B>
-
- Type Parameters:
A
- type for the left coder.B
- type for the right coder.
- All Implemented Interfaces:
java.io.Serializable
,EncoderFactory<Pair<A,B>>
public final class PairEncoderFactory<A extends java.io.Serializable,B extends java.io.Serializable> extends java.lang.Object implements EncoderFactory<Pair<A,B>>
An EncoderFactory forPair
. Reference: KvCoder in BEAM.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.nemo.common.coder.EncoderFactory
EncoderFactory.DummyEncoderFactory, EncoderFactory.Encoder<T>
-
-
Field Summary
-
Fields inherited from interface org.apache.nemo.common.coder.EncoderFactory
DUMMY_ENCODER_FACTORY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EncoderFactory.Encoder<Pair<A,B>>
create(java.io.OutputStream outputStream)
Get an encoder instance.static <A extends java.io.Serializable,B extends java.io.Serializable>
PairEncoderFactory<A,B>of(EncoderFactory<A> leftEncoderFactory, EncoderFactory<B> rightEncoderFactory)
static initializer of the class.java.lang.String
toString()
-
-
-
Method Detail
-
of
public static <A extends java.io.Serializable,B extends java.io.Serializable> PairEncoderFactory<A,B> of(EncoderFactory<A> leftEncoderFactory, EncoderFactory<B> rightEncoderFactory)
static initializer of the class.- Type Parameters:
A
- type of the left element.B
- type of the right element.- Parameters:
leftEncoderFactory
- left coder.rightEncoderFactory
- right coder.- Returns:
- the new PairEncoderFactory.
-
create
public EncoderFactory.Encoder<Pair<A,B>> create(java.io.OutputStream outputStream) throws java.io.IOException
Description copied from interface:EncoderFactory
Get an encoder instance.- Specified by:
create
in interfaceEncoderFactory<A extends java.io.Serializable>
- Parameters:
outputStream
- the stream on which encoded bytes are written- Returns:
- the encoder instance.
- Throws:
java.io.IOException
- if fail to get the instance.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-