@Internal public final class FileSourceReader<T,SplitT extends FileSourceSplit> extends SingleThreadMultiplexSourceReaderBase<RecordAndPosition<T>,T,SplitT,FileSourceSplitState<SplitT>>
SourceReader
that read records from FileSourceSplit
.config, context, options, recordEmitter, splitFetcherManager
Constructor and Description |
---|
FileSourceReader(SourceReaderContext readerContext,
BulkFormat<T,SplitT> readerFormat,
Configuration config) |
Modifier and Type | Method and Description |
---|---|
protected FileSourceSplitState<SplitT> |
initializedState(SplitT split)
When new splits are added to the reader.
|
protected void |
onSplitFinished(Map<String,FileSourceSplitState<SplitT>> finishedSplitIds)
Handles the finished splits to clean the state if needed.
|
void |
start()
Start the reader.
|
protected SplitT |
toSplitType(String splitId,
FileSourceSplitState<SplitT> splitState)
Convert a mutable SplitStateT to immutable SplitT.
|
addSplits, close, getNumberOfCurrentlyAssignedSplits, handleSourceEvents, isAvailable, notifyNoMoreSplits, pollNext, snapshotState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
notifyCheckpointComplete
notifyCheckpointAborted
public FileSourceReader(SourceReaderContext readerContext, BulkFormat<T,SplitT> readerFormat, Configuration config)
public void start()
SourceReader
start
in interface SourceReader<T,SplitT extends FileSourceSplit>
start
in class SourceReaderBase<RecordAndPosition<T>,T,SplitT extends FileSourceSplit,FileSourceSplitState<SplitT extends FileSourceSplit>>
protected void onSplitFinished(Map<String,FileSourceSplitState<SplitT>> finishedSplitIds)
SourceReaderBase
onSplitFinished
in class SourceReaderBase<RecordAndPosition<T>,T,SplitT extends FileSourceSplit,FileSourceSplitState<SplitT extends FileSourceSplit>>
protected FileSourceSplitState<SplitT> initializedState(SplitT split)
SourceReaderBase
initializedState
in class SourceReaderBase<RecordAndPosition<T>,T,SplitT extends FileSourceSplit,FileSourceSplitState<SplitT extends FileSourceSplit>>
split
- a newly added split.protected SplitT toSplitType(String splitId, FileSourceSplitState<SplitT> splitState)
SourceReaderBase
toSplitType
in class SourceReaderBase<RecordAndPosition<T>,T,SplitT extends FileSourceSplit,FileSourceSplitState<SplitT extends FileSourceSplit>>
splitState
- splitState.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.