public abstract class SplitReaderAdapter<FROM_KEY,TO_KEY,FROM_VALUE,TO_VALUE> extends SplitReader<TO_KEY,TO_VALUE>
SplitReader
to convert types.Constructor and Description |
---|
SplitReaderAdapter(SplitReader<FROM_KEY,FROM_VALUE> delegate) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the record reader.
|
protected abstract TO_KEY |
convertKey(FROM_KEY key) |
protected abstract TO_VALUE |
convertValue(FROM_VALUE value) |
TO_KEY |
getCurrentKey()
Get the current key.
|
TO_VALUE |
getCurrentValue()
Get the current value.
|
void |
initialize(Split split)
Called once at initialization.
|
boolean |
nextKeyValue()
Read the next key, value pair.
|
getProgress
public SplitReaderAdapter(SplitReader<FROM_KEY,FROM_VALUE> delegate)
protected abstract TO_VALUE convertValue(FROM_VALUE value)
public void initialize(Split split) throws InterruptedException
SplitReader
initialize
in class SplitReader<TO_KEY,TO_VALUE>
split
- The split that defines the range of records to read.InterruptedException
public boolean nextKeyValue() throws InterruptedException
SplitReader
nextKeyValue
in class SplitReader<TO_KEY,TO_VALUE>
InterruptedException
public TO_KEY getCurrentKey() throws InterruptedException
SplitReader
getCurrentKey
in class SplitReader<TO_KEY,TO_VALUE>
InterruptedException
public TO_VALUE getCurrentValue() throws InterruptedException
SplitReader
getCurrentValue
in class SplitReader<TO_KEY,TO_VALUE>
InterruptedException
public void close()
SplitReader
close
in class SplitReader<TO_KEY,TO_VALUE>
Copyright © 2024 Cask Data, Inc. Licensed under the Apache License, Version 2.0.