Class StreamFormatAdapter<T>
- java.lang.Object
-
- org.apache.flink.connector.file.src.impl.StreamFormatAdapter<T>
-
- All Implemented Interfaces:
Serializable,org.apache.flink.api.java.typeutils.ResultTypeQueryable<T>,BulkFormat<T,FileSourceSplit>
@Internal public final class StreamFormatAdapter<T> extends Object implements BulkFormat<T,FileSourceSplit>
Adapter to turn aStreamFormatinto aBulkFormat.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStreamFormatAdapter.Reader<T>The reader adapter, fromStreamFormat.ReadertoBulkFormat.Reader.-
Nested classes/interfaces inherited from interface org.apache.flink.connector.file.src.reader.BulkFormat
BulkFormat.RecordIterator<T>
-
-
Constructor Summary
Constructors Constructor Description StreamFormatAdapter(StreamFormat<T> streamFormat)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BulkFormat.Reader<T>createReader(org.apache.flink.configuration.Configuration config, FileSourceSplit split)Creates a new reader that reads from thesplit's pathstarting at thesplit's offsetand readslengthbytes after the offset.org.apache.flink.api.common.typeinfo.TypeInformation<T>getProducedType()Gets the type produced by this format.booleanisSplittable()Checks whether this format is splittable.BulkFormat.Reader<T>restoreReader(org.apache.flink.configuration.Configuration config, FileSourceSplit split)Creates a new reader that reads fromsplit.path()starting atoffsetand reads untillengthbytes after the offset.
-
-
-
Constructor Detail
-
StreamFormatAdapter
public StreamFormatAdapter(StreamFormat<T> streamFormat)
-
-
Method Detail
-
createReader
public BulkFormat.Reader<T> createReader(org.apache.flink.configuration.Configuration config, FileSourceSplit split) throws IOException
Description copied from interface:BulkFormatCreates a new reader that reads from thesplit's pathstarting at thesplit's offsetand readslengthbytes after the offset.- Specified by:
createReaderin interfaceBulkFormat<T,FileSourceSplit>- Throws:
IOException
-
restoreReader
public BulkFormat.Reader<T> restoreReader(org.apache.flink.configuration.Configuration config, FileSourceSplit split) throws IOException
Description copied from interface:BulkFormatCreates a new reader that reads fromsplit.path()starting atoffsetand reads untillengthbytes after the offset. A number ofrecordsToSkiprecords should be read and discarded after the offset. This is typically part of restoring a reader to a checkpointed position.- Specified by:
restoreReaderin interfaceBulkFormat<T,FileSourceSplit>- Throws:
IOException
-
isSplittable
public boolean isSplittable()
Description copied from interface:BulkFormatChecks whether this format is splittable. Splittable formats allow Flink to create multiple splits per file, so that Flink can read multiple regions of the file concurrently.See
top-level JavaDocs(section "Splitting") for details.- Specified by:
isSplittablein interfaceBulkFormat<T,FileSourceSplit>
-
getProducedType
public org.apache.flink.api.common.typeinfo.TypeInformation<T> getProducedType()
Description copied from interface:BulkFormatGets the type produced by this format. This type will be the type produced by the file source as a whole.- Specified by:
getProducedTypein interfaceBulkFormat<T,FileSourceSplit>- Specified by:
getProducedTypein interfaceorg.apache.flink.api.java.typeutils.ResultTypeQueryable<T>
-
-