@Override
protected void mapNativeValue(
final GeoWaveInputKey key,
final Object value,
final org.apache.hadoop.mapreduce.Mapper<GeoWaveInputKey, ObjectWritable, GeoWaveInputKey, ObjectWritable>.Context context)
throws IOException, InterruptedException {
@SuppressWarnings("unchecked")
final double rank = samplingFunction.rank(sampleSize, (T) value);
if (rank > 0.0000000001) {
final AnalyticItemWrapper<Object> wrapper = itemWrapperFactory.create(value);
outputKey.setDataId(
new ByteArray(
keyManager.putData(
nestedGroupCentroidAssigner.getGroupForLevel(wrapper),
1.0 - rank,
key.getDataId().getBytes())));
outputKey.setInternalAdapterId(key.getInternalAdapterId());
outputKey.setGeoWaveKey(key.getGeoWaveKey());
context.write(outputKey, currentValue);
}
}