Package org.apache.nemo.common.coder
Interface EncoderFactory<T>
-
- Type Parameters:
T
- element type.
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
BeamEncoderFactory
,BytesEncoderFactory
,EncoderFactory.DummyEncoderFactory
,IntEncoderFactory
,LongEncoderFactory
,NemoEventEncoderFactory
,PairEncoderFactory
public interface EncoderFactory<T> extends java.io.Serializable
A encoder factory object which generates encoders that encode values of typeT
into byte streams. To avoid to generate instance-based coder such as Spark serializer for every encoding, user need to explicitly instantiate an encoder instance and use it.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
EncoderFactory.DummyEncoderFactory
Dummy encoder factory implementation which is not supposed to be used.static interface
EncoderFactory.Encoder<T>
Interface of Encoder.
-
Field Summary
Fields Modifier and Type Field Description static EncoderFactory
DUMMY_ENCODER_FACTORY
Dummy encoder factory.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description EncoderFactory.Encoder<T>
create(java.io.OutputStream outputStream)
Get an encoder instance.
-
-
-
Field Detail
-
DUMMY_ENCODER_FACTORY
static final EncoderFactory DUMMY_ENCODER_FACTORY
Dummy encoder factory.
-
-
Method Detail
-
create
EncoderFactory.Encoder<T> create(java.io.OutputStream outputStream) throws java.io.IOException
Get an encoder instance.- Parameters:
outputStream
- the stream on which encoded bytes are written- Returns:
- the encoder instance.
- Throws:
java.io.IOException
- if fail to get the instance.
-
-