Search in sources :

Example 1 with SingleFieldPersistentDataset

use of org.locationtech.geowave.core.store.data.SingleFieldPersistentDataset in project geowave by locationtech.

the class AbstractCommonIndexAggregationTest method generateObjects.

public static List<CommonIndexedPersistenceEncoding> generateObjects(final int count) {
    final List<CommonIndexedPersistenceEncoding> objects = Lists.newArrayListWithCapacity(count);
    for (int i = 0; i < count; i++) {
        final String dataId = "entry" + i;
        final PersistentDataset<Object> commonData = new MultiFieldPersistentDataset<>();
        commonData.addValue("value", new MockComponents.TestIndexFieldType(i));
        objects.add(new CommonIndexedPersistenceEncoding((short) 0, dataId.getBytes(), new byte[0], new byte[0], 0, commonData, new SingleFieldPersistentDataset<byte[]>()));
    }
    return objects;
}
Also used : MultiFieldPersistentDataset(org.locationtech.geowave.core.store.data.MultiFieldPersistentDataset) CommonIndexedPersistenceEncoding(org.locationtech.geowave.core.store.data.CommonIndexedPersistenceEncoding) MockComponents(org.locationtech.geowave.core.store.adapter.MockComponents) SingleFieldPersistentDataset(org.locationtech.geowave.core.store.data.SingleFieldPersistentDataset)

Example 2 with SingleFieldPersistentDataset

use of org.locationtech.geowave.core.store.data.SingleFieldPersistentDataset in project geowave by locationtech.

the class InternalRasterDataAdapter method encode.

@Override
public AdapterPersistenceEncoding encode(final GridCoverage entry, final AdapterToIndexMapping indexMapping, final Index index) {
    final PersistentDataset<Object> adapterExtendedData = new SingleFieldPersistentDataset<>();
    adapterExtendedData.addValue(RasterDataAdapter.DATA_FIELD_ID, ((RasterDataAdapter) adapter).getRasterTileFromCoverage(entry));
    final AdapterPersistenceEncoding encoding;
    if (entry instanceof FitToIndexGridCoverage) {
        encoding = new FitToIndexPersistenceEncoding(getAdapterId(), new byte[0], new MultiFieldPersistentDataset<>(), adapterExtendedData, ((FitToIndexGridCoverage) entry).getPartitionKey(), ((FitToIndexGridCoverage) entry).getSortKey());
    } else {
        // this shouldn't happen
        LOGGER.warn("Grid coverage is not fit to the index");
        encoding = new AdapterPersistenceEncoding(getAdapterId(), new byte[0], new MultiFieldPersistentDataset<>(), adapterExtendedData);
    }
    return encoding;
}
Also used : FitToIndexGridCoverage(org.locationtech.geowave.adapter.raster.FitToIndexGridCoverage) MultiFieldPersistentDataset(org.locationtech.geowave.core.store.data.MultiFieldPersistentDataset) AdapterPersistenceEncoding(org.locationtech.geowave.core.store.adapter.AdapterPersistenceEncoding) IndexedAdapterPersistenceEncoding(org.locationtech.geowave.core.store.adapter.IndexedAdapterPersistenceEncoding) FitToIndexPersistenceEncoding(org.locationtech.geowave.core.store.adapter.FitToIndexPersistenceEncoding) SingleFieldPersistentDataset(org.locationtech.geowave.core.store.data.SingleFieldPersistentDataset)

Aggregations

MultiFieldPersistentDataset (org.locationtech.geowave.core.store.data.MultiFieldPersistentDataset)2 SingleFieldPersistentDataset (org.locationtech.geowave.core.store.data.SingleFieldPersistentDataset)2 FitToIndexGridCoverage (org.locationtech.geowave.adapter.raster.FitToIndexGridCoverage)1 AdapterPersistenceEncoding (org.locationtech.geowave.core.store.adapter.AdapterPersistenceEncoding)1 FitToIndexPersistenceEncoding (org.locationtech.geowave.core.store.adapter.FitToIndexPersistenceEncoding)1 IndexedAdapterPersistenceEncoding (org.locationtech.geowave.core.store.adapter.IndexedAdapterPersistenceEncoding)1 MockComponents (org.locationtech.geowave.core.store.adapter.MockComponents)1 CommonIndexedPersistenceEncoding (org.locationtech.geowave.core.store.data.CommonIndexedPersistenceEncoding)1