public DeferredReadCommonIndexedPersistenceEncoding( final short adapterId, final byte[] dataId, final byte[] partitionKey, final byte[] sortKey, final int duplicateCount, final PersistentDataset<CommonIndexValue> commonData, final FlattenedUnreadData unreadData) { super( adapterId, dataId, partitionKey, sortKey, duplicateCount, commonData, new PersistentDataset<byte[]>(), new PersistentDataset<>()); this.unreadData = unreadData; }
public AsyncPersistenceEncoding( final short adapterId, final byte[] dataId, final byte[] partitionKey, final byte[] sortKey, final int duplicateCount, final BatchDataIndexRetrieval asyncRetrieval) { super( adapterId, dataId, partitionKey, sortKey, duplicateCount, new PersistentDataset<CommonIndexValue>(), new PersistentDataset<byte[]>(), new PersistentDataset<>()); this.asyncRetrieval = asyncRetrieval; }
public AdapterPersistenceEncoding( final short internalAdapterId, final byte[] dataId, final PersistentDataset<CommonIndexValue> commonData, final PersistentDataset<Object> adapterExtendedData) { super( internalAdapterId, dataId, null, null, 0, commonData, new PersistentDataset<byte[]>(), adapterExtendedData); // all data is identified by // the adapter, there is // inherently no unknown // data elements }
@Override public AdapterPersistenceEncoding encode( final ImageChip entry, final CommonIndexModel indexModel) { final Map<String, Object> fieldIdToValueMap = new HashMap<>(); fieldIdToValueMap.put(IMAGE_FIELD_NAME, entry.getImageBinary()); return new AdapterPersistenceEncoding( entry.getDataId(), new PersistentDataset<CommonIndexValue>(), new PersistentDataset<>(fieldIdToValueMap)); }
sortKey, duplicateCount, new PersistentDataset<CommonIndexValue>(), new PersistentDataset<byte[]>(), new PersistentDataset<>()); deferredFieldReader = new InstanceFieldValueReader( sortKey, duplicateCount, new PersistentDataset<CommonIndexValue>(), new PersistentDataset<byte[]>(), new PersistentDataset<>()); deferredFieldReader = new SupplierFieldValueReader(
/** filterKeyValue is executed second */ @Override public ReturnCode filterKeyValue(final Cell cell) throws IOException { if (wholeRowFilter) { // let filterRowCells do the work return ReturnCode.INCLUDE_AND_NEXT_COL; } commonData = new PersistentDataset<>(); unreadData = aggregateFieldData(cell, commonData); return applyFilter(cell); }
@Override public AdapterPersistenceEncoding encode( final GridCoverage entry, final CommonIndexModel indexModel) { final PersistentDataset<Object> adapterExtendedData = new PersistentDataset<>(); adapterExtendedData.addValue(DATA_FIELD_ID, getRasterTileFromCoverage(entry)); final AdapterPersistenceEncoding encoding; if (entry instanceof FitToIndexGridCoverage) { encoding = new FitToIndexPersistenceEncoding( new byte[0], new PersistentDataset<CommonIndexValue>(), 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( new byte[0], new PersistentDataset<CommonIndexValue>(), adapterExtendedData); } return encoding; }
/** Handle the entire row at one time */ @Override public void filterRowCells(final List<Cell> rowCells) throws IOException { if (!rowCells.isEmpty()) { final Iterator<Cell> it = rowCells.iterator(); GeoWaveKeyImpl rowKey = null; commonData = new PersistentDataset<>(); while (it.hasNext()) { final Cell cell = it.next(); // Grab rowkey from first cell if (rowKey == null) { rowKey = new GeoWaveKeyImpl( cell.getRowArray(), partitionKeyLength, cell.getRowOffset(), cell.getRowLength()); } unreadData = aggregateFieldData(cell, commonData); } final ReturnCode code = applyFilter(rowKey); if (code == ReturnCode.SKIP) { rowCells.clear(); } } }
@Override public AdapterPersistenceEncoding encode(final T entry, final CommonIndexModel indexModel) { final PersistentDataset<CommonIndexValue> indexData = new PersistentDataset<CommonIndexValue>(); final Set<String> nativeFieldsInIndex = new HashSet<String>(); final PersistentDataset<Object> extendedData = new PersistentDataset<Object>();
public IndexedAdapterPersistenceEncoding getAdapterEncoding(final DataTypeAdapter dataAdapter) { final PersistentDataset<Object> adapterExtendedValues = new PersistentDataset<>(); if (persistenceEncoding instanceof AbstractAdapterPersistenceEncoding) { ((AbstractAdapterPersistenceEncoding) persistenceEncoding).convertUnknownValues( dataAdapter, model); final PersistentDataset<Object> existingExtValues = ((AbstractAdapterPersistenceEncoding) persistenceEncoding).getAdapterExtendedData(); if (existingExtValues != null) { adapterExtendedValues.addValues(existingExtValues.getValues()); } } adapterEncoding = new IndexedAdapterPersistenceEncoding( persistenceEncoding.getInternalAdapterId(), persistenceEncoding.getDataId(), persistenceEncoding.getInsertionPartitionKey(), persistenceEncoding.getInsertionSortKey(), persistenceEncoding.getDuplicateCount(), persistenceEncoding.getCommonData(), new PersistentDataset<byte[]>(), adapterExtendedValues); return adapterEncoding; }
final IndexedPersistenceEncoding persistenceEncoding) { if ((filter != null) && (indexModel != null) && (adapter != null)) { final PersistentDataset<Object> adapterExtendedValues = new PersistentDataset<>(); if (persistenceEncoding instanceof AbstractAdapterPersistenceEncoding) { ((AbstractAdapterPersistenceEncoding) persistenceEncoding).convertUnknownValues( persistenceEncoding.getDuplicateCount(), persistenceEncoding.getCommonData(), new PersistentDataset<byte[]>(), adapterExtendedValues);
@Override public boolean apply(final MemoryStoreEntry input) { if ((readerParams.getFilter() != null) && options.isServerSideLibraryEnabled()) { final PersistentDataset<CommonIndexValue> commonData = new PersistentDataset<>(); final List<FlattenedUnreadData> unreadData = new ArrayList<>(); final List<String> commonIndexFieldNames = DataStoreUtils.getUniqueDimensionFields(readerParams.getIndex().getIndexModel()); for (final GeoWaveValue v : input.getRow().getFieldValues()) { unreadData.add( DataStoreUtils.aggregateFieldData( input.getRow(), v, commonData, readerParams.getIndex().getIndexModel(), commonIndexFieldNames)); } return readerParams.getFilter().accept( readerParams.getIndex().getIndexModel(), new DeferredReadCommonIndexedPersistenceEncoding( input.getRow().getAdapterId(), input.getRow().getDataId(), input.getRow().getPartitionKey(), input.getRow().getSortKey(), input.getRow().getNumberOfDuplicates(), commonData, unreadData.isEmpty() ? null : new UnreadFieldDataList(unreadData))); } return true; } }), readerParams.getRowTransformer());