K
- the type of the keys returned by the internal readerV
- the type of the values returned by the internal reader
public class SpatialFilterRecordReader<K,V>
extends java.lang.Object
A record reader that can spatially filter the output of another record reader.
The internal reader's output is interpret using an instance of RecordInfoProvider
and a spatial operation is performed. If the spatial operation returns true for the current record, the record's key and value are returned, otherwise, the internal reader's next() method is called until one record satisfies the condition
Constructor and Description |
---|
SpatialFilterRecordReader(JobConf conf, <any> internalReader, RecordInfoProvider<K,V> riProvider, SpatialOperationConfig spatialOpConf)
Creates a new instance and sets it to use the given internal reader.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
K |
createKey() |
V |
createValue() |
long |
getPos() |
float |
getProgress() |
boolean |
next(K key, V value) |
public SpatialFilterRecordReader(JobConf conf, <any> internalReader, RecordInfoProvider<K,V> riProvider, SpatialOperationConfig spatialOpConf)
conf
- the job configurationinternalReader
- the reader used to read the data. Records gotten from this reader will be spatially filtered.riProvider
- a RecordInfoProvider
instancespatialOpConf
- the spatial operation configuration. It should contain the type of operation and the query window to filter against.public void close() throws java.io.IOException
java.io.IOException
public K createKey()
public V createValue()
public long getPos() throws java.io.IOException
java.io.IOException
public float getProgress() throws java.io.IOException
java.io.IOException
Copyright © 2017 Oracle and/or its affiliates. All Rights Reserved.