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.Readerimplementation that reads the file as anFSDataInputStreamand decodes the record with theDecoderBasedReader.Decoder.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDecoderBasedReader.Decoder<T>ADecoderBasedReader.Decoderto decode the file content into the actual records.static classDecoderBasedReader.Factory<T>Factory forDecoderBasedReader.
-
Constructor Summary
Constructors Constructor Description DecoderBasedReader(org.apache.flink.core.fs.Path path, DecoderBasedReader.Decoder<T> decoder)
-
-
-
Constructor Detail
-
DecoderBasedReader
public DecoderBasedReader(org.apache.flink.core.fs.Path path, DecoderBasedReader.Decoder<T> decoder) throws IOException- Throws:
IOException
-
-
Method Detail
-
read
public T read() throws IOException
- Specified by:
readin interfaceRecordWiseFileCompactor.Reader<T>- Returns:
- The next record, or null if no more available.
- Throws:
IOException
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-