K
- The type of the keys returned by the internalInputFormatV
- the type of the values returned by the internalInputFormatpublic class SpatialIndexingMapper<K,V> extends org.apache.hadoop.mapred.MapReduceBase implements org.apache.hadoop.mapred.Mapper<org.apache.hadoop.io.NullWritable,org.apache.hadoop.mapred.FileSplit,org.apache.hadoop.io.Text,RTreeWritable>
This mapper generates a spatial index for each FileSplit input value.
The output key will be the string representation of the input FileSplit and the value will be an instance of RTreeWritable
.
The resulting RTree will contain instances of RecordInfo
which are built using the information returned by the configured RecordInfoProvider
.
Optionally, MVSuggest can be used to find an approximate location for records with no geometry. If the location's geometry found for a record is other than a point, a centroid is calculated and assigned to the record as its geometry. If it is the case, the RecordInfoProvider should also implement LocalizableRecordInfoProvider
in order to retrieve the search text for each record
Expected configuration
Constructor and Description |
---|
SpatialIndexingMapper() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
configure(org.apache.hadoop.mapred.JobConf conf) |
void |
map(org.apache.hadoop.io.NullWritable key, org.apache.hadoop.mapred.FileSplit value, org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.Text,RTreeWritable> out, org.apache.hadoop.mapred.Reporter reporter) |
public void configure(org.apache.hadoop.mapred.JobConf conf)
configure
in interface org.apache.hadoop.mapred.JobConfigurable
configure
in class org.apache.hadoop.mapred.MapReduceBase
public void map(org.apache.hadoop.io.NullWritable key, org.apache.hadoop.mapred.FileSplit value, org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.Text,RTreeWritable> out, org.apache.hadoop.mapred.Reporter reporter) throws java.io.IOException
map
in interface org.apache.hadoop.mapred.Mapper<org.apache.hadoop.io.NullWritable,org.apache.hadoop.mapred.FileSplit,org.apache.hadoop.io.Text,RTreeWritable>
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class org.apache.hadoop.mapred.MapReduceBase
java.io.IOException