Class DecoderBasedReader<T>
- java.lang.Object
-
- org.apache.flink.connector.file.sink.compactor.DecoderBasedReader<T>
-
- All Implemented Interfaces:
AutoCloseable
,RecordWiseFileCompactor.Reader<T>
@PublicEvolving public class DecoderBasedReader<T> extends Object implements RecordWiseFileCompactor.Reader<T>
ARecordWiseFileCompactor.Reader
implementation that reads the file as anFSDataInputStream
and decodes the record with theDecoderBasedReader.Decoder
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
DecoderBasedReader.Decoder<T>
ADecoderBasedReader.Decoder
to decode the file content into the actual records.static class
DecoderBasedReader.Factory<T>
Factory forDecoderBasedReader
.
-
Constructor Summary
Constructors Constructor Description DecoderBasedReader(Path path, DecoderBasedReader.Decoder<T> decoder)
-
-
-
Constructor Detail
-
DecoderBasedReader
public DecoderBasedReader(Path path, DecoderBasedReader.Decoder<T> decoder) throws IOException
- Throws:
IOException
-
-
Method Detail
-
read
public T read() throws IOException
- Specified by:
read
in interfaceRecordWiseFileCompactor.Reader<T>
- Returns:
- The next record, or null if no more available.
- Throws:
IOException
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
-