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;
}
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;
}
Aggregations