I
- type of values produced by this inputpublic final class ConcatenatingInputReader<I> extends InputReader<I>
Constructor and Description |
---|
ConcatenatingInputReader(List<? extends InputReader<I>> readers) |
Modifier and Type | Method and Description |
---|---|
void |
beginShard()
Performs setup at the beginning of the shard.
|
void |
beginSlice()
Prepares the
InputReader for reading, after possibly having gone
through serialization and deserialization. |
void |
endShard()
Called after endSlice if there will not be any subsequent calls to beginSlice or next.
|
void |
endSlice()
Prepares the
InputReader for serialization. |
long |
estimateMemoryRequirement()
Returns the estimated memory that will be used by this reader in bytes.
|
Double |
getProgress()
Returns the relative progress reading this input as a number from 0 to 1.
|
I |
next()
Returns the next input value, or throws
NoSuchElementException
when there is no more input data. |
close, getContext, open, setContext
public ConcatenatingInputReader(List<? extends InputReader<I>> readers)
public void beginSlice() throws IOException
InputReader
InputReader
for reading, after possibly having gone
through serialization and deserialization.beginSlice
in class InputReader<I>
IOException
- in the event of failurepublic void endSlice() throws IOException
InputReader
InputReader
for serialization.endSlice
in class InputReader<I>
IOException
- in the event of failurepublic I next() throws IOException, NoSuchElementException
InputReader
NoSuchElementException
when there is no more input data. This is done rather than providing a
hasNext() function, to allow the implementation to deal with streams and
remain serializable, even if the item being read is not.next
in class InputReader<I>
IOException
NoSuchElementException
public Double getProgress()
InputReader
getProgress
in class InputReader<I>
public void beginShard()
InputReader
InputReader.beginSlice()
. It will not be invoked again unless the shard restarts. When a shard is
restarted, this method is invoked and the input should be read from the beginning.beginShard
in class InputReader<I>
public void endShard() throws IOException
InputReader
endShard
in class InputReader<I>
IOException
- in the event of failurepublic long estimateMemoryRequirement()
InputReader
estimateMemoryRequirement
in class InputReader<I>
Copyright © 2015 Google. All rights reserved.