T - the type of the elements read from the sourcepublic abstract class Reader<T> extends Observable
A Source is read from by getting an
Iterator-like value and iterating through it.
This class is intended for formats that have built-in support on the Dataflow service.
Do not introduce new implementations: for creating new input formats, use
Source instead.
| Modifier and Type | Class and Description |
|---|---|
static class |
Reader.AbstractReaderIterator<T>
An abstract base class for ReaderIterator implementations.
|
static interface |
Reader.DynamicSplitRequest
A framework-specific way to specify how
Reader.ReaderIterator.requestDynamicSplit(com.google.cloud.dataflow.sdk.util.common.worker.Reader.DynamicSplitRequest) should split
the input into a primary and residual part. |
static interface |
Reader.DynamicSplitResult
A framework-specific way to specify how
Reader.ReaderIterator.requestDynamicSplit(com.google.cloud.dataflow.sdk.util.common.worker.Reader.DynamicSplitRequest) has split
the input into a primary and residual part. |
static class |
Reader.DynamicSplitResultWithPosition
A
Reader.DynamicSplitResult that specifies the boundary between the primary and
residual parts of the input using a Reader.Position. |
static interface |
Reader.Position
A representation of a position in an iteration through a
Reader. |
static interface |
Reader.Progress
A representation of how far a
ReaderIterator is through a
Reader. |
static interface |
Reader.ReaderIterator<T>
A stateful iterator over the data in a Reader.
|
| Modifier and Type | Field and Description |
|---|---|
protected StateSampler |
stateSampler
StateSampler object for readers interested in further breaking
down of the state space at a finer granularity.
|
protected String |
stateSamplerOperationName
Name to be used as a prefix with
stateSampler. |
| Constructor and Description |
|---|
Reader() |
| Modifier and Type | Method and Description |
|---|---|
abstract Reader.ReaderIterator<T> |
iterator()
Returns a ReaderIterator that allows reading from this source.
|
protected void |
notifyElementRead(long byteSize)
Utility method to notify observers about a new element, which has
been read by this Reader, and its size in bytes.
|
void |
setStateSamplerAndOperationName(StateSampler stateSampler,
String stateSamplerOperationName)
Sets the state sampler and the state sampler operation name.
|
boolean |
supportsRestart()
Returns whether this Reader can be restarted.
|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedprotected StateSampler stateSampler
protected String stateSamplerOperationName
stateSampler.public void setStateSamplerAndOperationName(StateSampler stateSampler, String stateSamplerOperationName)
stateSampler - the StateSampler objectstateSamplerOperationName - the operation name to be used by
the state samplerpublic abstract Reader.ReaderIterator<T> iterator() throws IOException
IOExceptionprotected void notifyElementRead(long byteSize)
public boolean supportsRestart()