use of org.locationtech.geowave.core.store.operations.RowReaderWrapper in project geowave by locationtech.
the class CassandraOperations method createReader.
@Override
public RowReader<GeoWaveRow> createReader(final DataIndexReaderParams readerParams) {
final byte[][] dataIds;
Iterator<GeoWaveRow> iterator;
if (readerParams.getDataIds() == null) {
if ((readerParams.getStartInclusiveDataId() != null) || (readerParams.getEndInclusiveDataId() != null)) {
final List<byte[]> intermediaries = new ArrayList<>();
ByteArrayUtils.addAllIntermediaryByteArrays(intermediaries, new ByteArrayRange(readerParams.getStartInclusiveDataId(), readerParams.getEndInclusiveDataId()));
dataIds = intermediaries.toArray(new byte[0][]);
iterator = getRows(dataIds, readerParams.getAdapterId());
} else {
iterator = getRows(readerParams.getAdapterId());
}
} else {
dataIds = readerParams.getDataIds();
iterator = getRows(dataIds, readerParams.getAdapterId());
}
if (options.isVisibilityEnabled()) {
Stream<GeoWaveRow> stream = Streams.stream(iterator);
final Set<String> authorizations = Sets.newHashSet(readerParams.getAdditionalAuthorizations());
stream = stream.filter(new ClientVisibilityFilter(authorizations));
iterator = stream.iterator();
}
return new RowReaderWrapper<>(new CloseableIterator.Wrapper(iterator));
}
use of org.locationtech.geowave.core.store.operations.RowReaderWrapper in project geowave by locationtech.
the class DynamoDBOperations method createReader.
@Override
public RowReader<GeoWaveRow> createReader(final DataIndexReaderParams readerParams) {
final String typeName = readerParams.getInternalAdapterStore().getTypeName(readerParams.getAdapterId());
if (typeName == null) {
return new RowReaderWrapper<>(new CloseableIterator.Empty<GeoWaveRow>());
}
byte[][] dataIds;
Iterator<GeoWaveRow> iterator;
if (readerParams.getDataIds() != null) {
dataIds = readerParams.getDataIds();
iterator = getRowsFromDataIndex(dataIds, readerParams.getAdapterId(), typeName);
} else {
if ((readerParams.getStartInclusiveDataId() != null) || (readerParams.getEndInclusiveDataId() != null)) {
final List<byte[]> intermediaries = new ArrayList<>();
ByteArrayUtils.addAllIntermediaryByteArrays(intermediaries, new ByteArrayRange(readerParams.getStartInclusiveDataId(), readerParams.getEndInclusiveDataId()));
dataIds = intermediaries.toArray(new byte[0][]);
iterator = getRowsFromDataIndex(dataIds, readerParams.getAdapterId(), typeName);
} else {
iterator = getRowsFromDataIndex(readerParams.getAdapterId(), typeName);
}
}
if (options.getBaseOptions().isVisibilityEnabled()) {
Stream<GeoWaveRow> stream = Streams.stream(iterator);
final Set<String> authorizations = Sets.newHashSet(readerParams.getAdditionalAuthorizations());
stream = stream.filter(new ClientVisibilityFilter(authorizations));
iterator = stream.iterator();
}
return new RowReaderWrapper<>(new CloseableIterator.Wrapper<>(iterator));
}
Aggregations