Class StreamFormatAdapter<T>
- java.lang.Object
-
- org.apache.flink.connector.file.src.impl.StreamFormatAdapter<T>
-
- All Implemented Interfaces:
Serializable
,ResultTypeQueryable<T>
,BulkFormat<T,FileSourceSplit>
@Internal public final class StreamFormatAdapter<T> extends Object implements BulkFormat<T,FileSourceSplit>
Adapter to turn aStreamFormat
into aBulkFormat
.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StreamFormatAdapter.Reader<T>
The reader adapter, fromStreamFormat.Reader
toBulkFormat.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(Configuration config, FileSourceSplit split)
Creates a new reader that reads from thesplit's path
starting at thesplit's offset
and readslength
bytes after the offset.TypeInformation<T>
getProducedType()
Gets the type produced by this format.boolean
isSplittable()
Checks whether this format is splittable.BulkFormat.Reader<T>
restoreReader(Configuration config, FileSourceSplit split)
Creates a new reader that reads fromsplit.path()
starting atoffset
and reads untillength
bytes after the offset.
-
-
-
Constructor Detail
-
StreamFormatAdapter
public StreamFormatAdapter(StreamFormat<T> streamFormat)
-
-
Method Detail
-
createReader
public BulkFormat.Reader<T> createReader(Configuration config, FileSourceSplit split) throws IOException
Description copied from interface:BulkFormat
Creates a new reader that reads from thesplit's path
starting at thesplit's offset
and readslength
bytes after the offset.- Specified by:
createReader
in interfaceBulkFormat<T,FileSourceSplit>
- Throws:
IOException
-
restoreReader
public BulkFormat.Reader<T> restoreReader(Configuration config, FileSourceSplit split) throws IOException
Description copied from interface:BulkFormat
Creates a new reader that reads fromsplit.path()
starting atoffset
and reads untillength
bytes after the offset. A number ofrecordsToSkip
records should be read and discarded after the offset. This is typically part of restoring a reader to a checkpointed position.- Specified by:
restoreReader
in interfaceBulkFormat<T,FileSourceSplit>
- Throws:
IOException
-
isSplittable
public boolean isSplittable()
Description copied from interface:BulkFormat
Checks 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:
isSplittable
in interfaceBulkFormat<T,FileSourceSplit>
-
getProducedType
public TypeInformation<T> getProducedType()
Description copied from interface:BulkFormat
Gets the type produced by this format. This type will be the type produced by the file source as a whole.- Specified by:
getProducedType
in interfaceBulkFormat<T,FileSourceSplit>
- Specified by:
getProducedType
in interfaceResultTypeQueryable<T>
- Returns:
- The data type produced by this function or input format.
-
-