KEY
- The key type.VALUE
- The value type.public abstract class SplitReaderBase<KEY,VALUE> extends SplitReader<KEY,VALUE>
SplitReader
.
Iterates over split data using the fetchNextKeyValue()
method.
Constructor and Description |
---|
SplitReaderBase() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the record reader.
|
protected abstract boolean |
fetchNextKeyValue()
Fetches the next data item of the split being read.
|
KEY |
getCurrentKey()
Get the current key.
|
VALUE |
getCurrentValue()
Get the current value.
|
boolean |
nextKeyValue()
Read the next key, value pair.
|
protected void |
setCurrentKeyValue(KEY key,
VALUE value) |
getProgress, initialize
protected abstract boolean fetchNextKeyValue()
setCurrentKeyValue(Object, Object)
method to
set the new current key/value. If false there are no more key/value records to read.
See IteratorBasedSplitReader
for an implementation
of the abstract fetchNextKeyValue() method.public boolean nextKeyValue() throws InterruptedException
SplitReader
nextKeyValue
in class SplitReader<KEY,VALUE>
InterruptedException
public KEY getCurrentKey() throws InterruptedException
SplitReader
getCurrentKey
in class SplitReader<KEY,VALUE>
InterruptedException
public VALUE getCurrentValue() throws InterruptedException
SplitReader
getCurrentValue
in class SplitReader<KEY,VALUE>
InterruptedException
public void close()
SplitReader
close
in class SplitReader<KEY,VALUE>
Copyright © 2022 Cask Data, Inc. Licensed under the Apache License, Version 2.0.