Search in sources :

Example 1 with PersistentDataset

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;
        }
    }
}
Also used : AbstractAdapterPersistenceEncoding(org.locationtech.geowave.core.store.adapter.AbstractAdapterPersistenceEncoding) MultiFieldPersistentDataset(org.locationtech.geowave.core.store.data.MultiFieldPersistentDataset) IndexImpl(org.locationtech.geowave.core.store.index.IndexImpl) IndexedAdapterPersistenceEncoding(org.locationtech.geowave.core.store.adapter.IndexedAdapterPersistenceEncoding) PersistentDataset(org.locationtech.geowave.core.store.data.PersistentDataset) MultiFieldPersistentDataset(org.locationtech.geowave.core.store.data.MultiFieldPersistentDataset)

Aggregations

AbstractAdapterPersistenceEncoding (org.locationtech.geowave.core.store.adapter.AbstractAdapterPersistenceEncoding)1 IndexedAdapterPersistenceEncoding (org.locationtech.geowave.core.store.adapter.IndexedAdapterPersistenceEncoding)1 MultiFieldPersistentDataset (org.locationtech.geowave.core.store.data.MultiFieldPersistentDataset)1 PersistentDataset (org.locationtech.geowave.core.store.data.PersistentDataset)1 IndexImpl (org.locationtech.geowave.core.store.index.IndexImpl)1