use of org.locationtech.geowave.core.store.data.PersistentDataset in project geowave by locationtech.
the class AggregationIterator method aggregateRow.
protected void aggregateRow(final Text currentRow, final CommonIndexModel model, final CommonIndexedPersistenceEncoding persistenceEncoding) {
if (adapter == null) {
aggregationFunction.aggregate(null, persistenceEncoding);
endRowOfAggregation = currentRow;
} else if (((Short) (persistenceEncoding.getInternalAdapterId())).equals((adapter.getAdapterId()))) {
final PersistentDataset<Object> adapterExtendedValues = new MultiFieldPersistentDataset<>();
if (persistenceEncoding instanceof AbstractAdapterPersistenceEncoding) {
((AbstractAdapterPersistenceEncoding) persistenceEncoding).convertUnknownValues(adapter, model);
final PersistentDataset<Object> existingExtValues = ((AbstractAdapterPersistenceEncoding) persistenceEncoding).getAdapterExtendedData();
if (existingExtValues != null) {
adapterExtendedValues.addValues(existingExtValues.getValues());
}
}
final IndexedAdapterPersistenceEncoding encoding = new IndexedAdapterPersistenceEncoding(persistenceEncoding.getInternalAdapterId(), persistenceEncoding.getDataId(), persistenceEncoding.getInsertionPartitionKey(), persistenceEncoding.getInsertionSortKey(), persistenceEncoding.getDuplicateCount(), persistenceEncoding.getCommonData(), new MultiFieldPersistentDataset<byte[]>(), adapterExtendedValues);
// the data adapter can't use the numeric index strategy and only
// the common index model to decode which is the case for feature
// data, we pass along a null strategy to eliminate the necessity to
// send a serialization of the strategy in the options of this
// iterator
final Object row = adapter.decode(encoding, indexMapping, new IndexImpl(null, model));
if (row != null) {
// for now ignore field info
aggregationFunction.aggregate(adapter, row);
endRowOfAggregation = currentRow;
}
}
}
Aggregations