@Internal public class LimitableBulkFormat<T,SplitT extends FileSourceSplit> extends Object implements BulkFormat<T,SplitT>
BulkFormat
that can limit output record number.BulkFormat.Reader<T>, BulkFormat.RecordIterator<T>
Modifier and Type | Method and Description |
---|---|
static <T,SplitT extends FileSourceSplit> |
create(BulkFormat<T,SplitT> format,
Long limit) |
BulkFormat.Reader<T> |
createReader(Configuration config,
SplitT split)
Creates a new reader that reads from the
split's path starting
at the split's offset and reads length 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,
SplitT split)
Creates a new reader that reads from
split.path() starting at offset and
reads until length bytes after the offset. |
public BulkFormat.Reader<T> createReader(Configuration config, SplitT split) throws IOException
BulkFormat
split's path
starting
at the split's offset
and reads length
bytes after the offset.createReader
in interface BulkFormat<T,SplitT extends FileSourceSplit>
IOException
public BulkFormat.Reader<T> restoreReader(Configuration config, SplitT split) throws IOException
BulkFormat
split.path()
starting at offset
and
reads until length
bytes after the offset. A number of recordsToSkip
records
should be read and discarded after the offset. This is typically part of restoring a reader
to a checkpointed position.restoreReader
in interface BulkFormat<T,SplitT extends FileSourceSplit>
IOException
public boolean isSplittable()
BulkFormat
See top-level JavaDocs
(section "Splitting") for details.
isSplittable
in interface BulkFormat<T,SplitT extends FileSourceSplit>
public TypeInformation<T> getProducedType()
BulkFormat
getProducedType
in interface ResultTypeQueryable<T>
getProducedType
in interface BulkFormat<T,SplitT extends FileSourceSplit>
public static <T,SplitT extends FileSourceSplit> BulkFormat<T,SplitT> create(BulkFormat<T,SplitT> format, Long limit)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.