Class LimitableBulkFormat<T,SplitT extends FileSourceSplit>
java.lang.Object
org.apache.flink.connector.file.table.LimitableBulkFormat<T,SplitT>
- All Implemented Interfaces:
Serializable,org.apache.flink.api.java.typeutils.ResultTypeQueryable<T>,BulkFormat<T,SplitT>
@Internal
public class LimitableBulkFormat<T,SplitT extends FileSourceSplit>
extends Object
implements BulkFormat<T,SplitT>
A
BulkFormat that can limit output record number.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.flink.connector.file.src.reader.BulkFormat
BulkFormat.Reader<T>, BulkFormat.RecordIterator<T> -
Method Summary
Modifier and TypeMethodDescriptionstatic <T,SplitT extends FileSourceSplit>
BulkFormat<T,SplitT> create(BulkFormat<T, SplitT> format, Long limit) createReader(org.apache.flink.configuration.Configuration config, SplitT split) Creates a new reader that reads from thesplit's pathstarting at thesplit's offsetand readslengthbytes after the offset.longgetLimit()org.apache.flink.api.common.typeinfo.TypeInformation<T>Gets the type produced by this format.booleanChecks whether this format is splittable.restoreReader(org.apache.flink.configuration.Configuration config, SplitT split) Creates a new reader that reads fromsplit.path()starting atoffsetand reads untillengthbytes after the offset.
-
Method Details
-
createReader
public BulkFormat.Reader<T> createReader(org.apache.flink.configuration.Configuration config, SplitT 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,SplitT extends FileSourceSplit> - Throws:
IOException
-
restoreReader
public BulkFormat.Reader<T> restoreReader(org.apache.flink.configuration.Configuration config, SplitT 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,SplitT extends FileSourceSplit> - Throws:
IOException
-
getLimit
public long getLimit() -
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,SplitT extends FileSourceSplit>
-
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,SplitT extends FileSourceSplit> - Specified by:
getProducedTypein interfaceorg.apache.flink.api.java.typeutils.ResultTypeQueryable<T>
-
create
public static <T,SplitT extends FileSourceSplit> BulkFormat<T,SplitT> create(BulkFormat<T, SplitT> format, Long limit)
-