@InterfaceAudience.Public
@InterfaceStability.Evolving
public abstract class KeyValueReader
extends org.apache.tez.runtime.api.Reader
Reader
.
Example usage
while (kvReader.next()) {
Object key = kvReader.getCurrentKey();
Object value = kvReader.getCurrentValue();
if next() is called after processing everything,
IOException would be thrownModifier and Type | Field and Description |
---|---|
protected boolean |
completedProcessing |
Constructor and Description |
---|
KeyValueReader() |
Modifier and Type | Method and Description |
---|---|
abstract Object |
getCurrentKey()
Returns the current key
|
abstract Object |
getCurrentValue()
Returns the current value
|
protected void |
hasCompletedProcessing()
Check whether processing has been completed.
|
abstract boolean |
next()
Moves to the next key/values(s) pair
|
public abstract boolean next() throws IOException
IOException
- if an error occurs{@link
- IOInterruptedException} if IO was performing a blocking operation and was interruptedpublic abstract Object getCurrentKey() throws IOException
IOException
public abstract Object getCurrentValue() throws IOException
IOException
protected void hasCompletedProcessing() throws IOException
IOException
Copyright © 2024 Apache Software Foundation. All rights reserved.