@Override protected QueryRanges getRanges( final int maxRangeDecomposition, final double[] targetResolutionPerDimensionForHierarchicalIndex) { return DataStoreUtils.constraintsToQueryRanges( constraints, index.getIndexStrategy(), targetResolutionPerDimensionForHierarchicalIndex, maxRangeDecomposition, indexMetaData); } }
public boolean init( final List<QueryFilter> filterList, final CommonIndexModel model, final String[] visList) { this.filterList.clear(); this.filterList.addAll(filterList); this.model = model; commonIndexFieldIds = DataStoreUtils.getUniqueDimensionFields(model); return true; }
default boolean mergeData( final Index index, final PersistentAdapterStore adapterStore, final InternalAdapterStore internalAdapterStore, final AdapterIndexMappingStore adapterIndexMappingStore, final Integer maxRangeDecomposition) { return DataStoreUtils.mergeData( this, maxRangeDecomposition, index, adapterStore, internalAdapterStore, adapterIndexMappingStore); }
@SuppressWarnings("unchecked") private CloseableIterator<T> wrapResults( final CloseableIterator<CassandraRow> results, final RangeReaderParams<T> readerParams) { final Set<String> authorizations = Sets.newHashSet(readerParams.getAdditionalAuthorizations()); final Iterator<GeoWaveRow> iterator = (Iterator) Iterators.filter(results, new ClientVisibilityFilter(authorizations)); return new CloseableIteratorWrapper<>( results, rowTransformer.apply( DataStoreUtils.isMergingIteratorRequired(readerParams, visibilityEnabled) ? new GeoWaveRowMergingIterator(iterator) : iterator)); }
DataStoreUtils.constraintsToQueryRanges( constraints, nextIdx.getIndexStrategy(), null, maxRangeDecomposition); final long temp = DataStoreUtils.cardinality(nextIdx, stats, ranges); if (temp < min) { bestIdx = nextIdx;
@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());
protected FlattenedUnreadData aggregateFieldData( final Cell cell, final PersistentDataset<CommonIndexValue> commonData) { final byte[] qualBuf = CellUtil.cloneQualifier(cell); final byte[] valBuf = CellUtil.cloneValue(cell); final FlattenedDataSet dataSet = DataStoreUtils.decomposeFlattenedFields( qualBuf, valBuf, null, commonIndexFieldIds.size() - 1); final List<FlattenedFieldInfo> fieldInfos = dataSet.getFieldsRead(); for (final FlattenedFieldInfo fieldInfo : fieldInfos) { final int ordinal = fieldInfo.getFieldPosition(); if (ordinal < commonIndexFieldIds.size()) { final String commonIndexFieldName = commonIndexFieldIds.get(ordinal); final FieldReader<? extends CommonIndexValue> reader = model.getReader(commonIndexFieldName); if (reader != null) { final CommonIndexValue fieldValue = reader.readField(fieldInfo.getValue()); commonData.addValue(commonIndexFieldName, fieldValue); } else { LOGGER.error("Could not find reader for common index field: " + commonIndexFieldName); } } } return dataSet.getFieldsDeferred(); }
@SuppressWarnings("unchecked") private CloseableIterator<T> wrapResults( final Iterator<GeoWaveRedisRow> results, final RangeReaderParams<T> params, final GeoWaveRowIteratorTransformer<T> rowTransformer, final Set<String> authorizations, final boolean visibilityEnabled) { final Iterator<GeoWaveRow> iterator = (Iterator) Iterators.filter(results, new ClientVisibilityFilter(authorizations)); return new CloseableIterator.Wrapper<>( rowTransformer.apply( sortBySortKeyIfRequired( params, DataStoreUtils.isMergingIteratorRequired(params, visibilityEnabled) ? new GeoWaveRowMergingIterator(iterator) : iterator))); }
final byte[] valueBytes = value.getValue(); final FlattenedDataSet dataSet = DataStoreUtils.decomposeFlattenedFields( fieldMask, valueBytes,
@SuppressWarnings("unchecked") private CloseableIterator<T> wrapResults( final Closeable closeable, final Iterator<GeoWaveRow> results, final RangeReaderParams<T> params, final GeoWaveRowIteratorTransformer<T> rowTransformer, final Set<String> authorizations, final boolean visibilityEnabled) { final Iterator<GeoWaveRow> iterator = Iterators.filter(results, new ClientVisibilityFilter(authorizations)); return new CloseableIteratorWrapper<>( closeable, rowTransformer.apply( sortBySortKeyIfRequired( params, DataStoreUtils.isMergingIteratorRequired(params, visibilityEnabled) ? new GeoWaveRowMergingIterator(iterator) : iterator))); }
if ((maxSplits != null) && (maxSplits > 0)) { ranges = DataStoreUtils.constraintsToQueryRanges( indexConstraints, indexStrategy, } else { ranges = DataStoreUtils.constraintsToQueryRanges( indexConstraints, indexStrategy,
protected List<String> getDimensionFieldNames(final CommonIndexModel model) { final List<String> retVal = modelToDimensionsMap.get(model.getId()); if (retVal != null) { return retVal; } final List<String> dimensionFieldNames = DataStoreUtils.getUniqueDimensionFields(model); modelToDimensionsMap.put(model.getId(), dimensionFieldNames); return dimensionFieldNames; }
private void readValue(final GeoWaveValue value) { final List<FlattenedFieldInfo> fieldInfos = DataStoreUtils.decomposeFlattenedFields( value.getFieldMask(), value.getValue(),
@Override public boolean mergeData( final Index index, final PersistentAdapterStore adapterStore, final InternalAdapterStore internalAdapterStore, final AdapterIndexMappingStore adapterIndexMappingStore, final Integer maxRangeDecomposition) { if (options.isServerSideLibraryEnabled()) { final TableName tableName = getTableName(index.getName()); try (Admin admin = conn.getAdmin()) { admin.compact(tableName); // wait for table compaction to finish while (!admin.getCompactionState(tableName).equals(CompactionState.NONE)) { Thread.sleep(100); } } catch (final Exception e) { LOGGER.error("Cannot compact table '" + index.getName() + "'", e); return false; } } else { return DataStoreUtils.mergeData( this, maxRangeDecomposition, index, adapterStore, internalAdapterStore, adapterIndexMappingStore); } return true; }
requests, tableName, DataStoreUtils.isMergingIteratorRequired(readerParams, visibilityEnabled), readerParams.getMaxResolutionSubsamplingPerDimension() == null);
if ((maxSplits != null) && (maxSplits > 0)) { ranges = DataStoreUtils.constraintsToQueryRanges( indexConstraints, indexStrategy, } else { ranges = DataStoreUtils.constraintsToQueryRanges( indexConstraints, indexStrategy,
public boolean init(final byte[] filterBytes, final byte[] modelBytes) { filterList.clear(); if ((filterBytes != null) && (filterBytes.length > 0)) { final List<Persistable> decodedFilterList = URLClassloaderUtils.fromBinaryAsList(filterBytes); if (decodedFilterList == null) { LOGGER.error("Failed to decode filter list"); return false; } for (final Persistable decodedFilter : decodedFilterList) { if (decodedFilter instanceof QueryFilter) { filterList.add((QueryFilter) decodedFilter); } else { LOGGER.warn("Unrecognized type for decoded filter!" + decodedFilter.getClass().getName()); } } } model = (CommonIndexModel) URLClassloaderUtils.fromBinary(modelBytes); if (model == null) { LOGGER.error("Failed to decode index model"); return false; } commonIndexFieldIds = DataStoreUtils.getUniqueDimensionFields(model); return true; }
ranges, new ClientVisibilityFilter(authorizations), DataStoreUtils.isMergingIteratorRequired( readerParams, client.isVisibilityEnabled()),
final MultiRowRangeFilter multiFilter = getMultiRowRangeFilter( DataStoreUtils.constraintsToQueryRanges( readerParams.getConstraints(), readerParams.getIndex().getIndexStrategy(),
rowTransformer, new ClientVisibilityFilter(authorizations), DataStoreUtils.isMergingIteratorRequired(readerParams, visibilityEnabled), async, RedisUtils.isGroupByRowAndIsSortByTime(readerParams, adapterId),