use of org.locationtech.geowave.core.store.operations.RangeReaderParams in project geowave by locationtech.
the class FileSystemReader method createIterator.
private CloseableIterator<T> createIterator(final FileSystemClient client, final RangeReaderParams<T> readerParams, final GeoWaveRowIteratorTransformer<T> rowTransformer, final Collection<SinglePartitionQueryRanges> ranges, final Set<String> authorizations, final boolean async) {
final Iterator<CloseableIterator> it = Arrays.stream(ArrayUtils.toObject(readerParams.getAdapterIds())).map(adapterId -> new FileSystemQueryExecution(client, adapterId, readerParams.getInternalAdapterStore().getTypeName(adapterId), readerParams.getIndex().getName(), client.getFormat(), rowTransformer, ranges, new ClientVisibilityFilter(authorizations), DataStoreUtils.isMergingIteratorRequired(readerParams, client.isVisibilityEnabled()), async, FileSystemUtils.isGroupByRowAndIsSortByTime(readerParams, adapterId), FileSystemUtils.isSortByKeyRequired(readerParams)).results()).iterator();
final CloseableIterator<T>[] itArray = Iterators.toArray(it, CloseableIterator.class);
return new CloseableIteratorWrapper<>(new Closeable() {
AtomicBoolean closed = new AtomicBoolean(false);
@Override
public void close() throws IOException {
if (!closed.getAndSet(true)) {
Arrays.stream(itArray).forEach(it -> it.close());
}
}
}, Iterators.concat(itArray));
}
use of org.locationtech.geowave.core.store.operations.RangeReaderParams in project geowave by locationtech.
the class RedisReader method createIterator.
private CloseableIterator<T> createIterator(final RedissonClient client, final Compression compression, final RangeReaderParams<T> readerParams, final GeoWaveRowIteratorTransformer<T> rowTransformer, final String namespace, final Collection<SinglePartitionQueryRanges> ranges, final Set<String> authorizations, final boolean visibilityEnabled, final boolean async) {
final Iterator<CloseableIterator> it = Arrays.stream(ArrayUtils.toObject(readerParams.getAdapterIds())).map(adapterId -> new BatchedRangeRead(client, compression, RedisUtils.getRowSetPrefix(namespace, readerParams.getInternalAdapterStore().getTypeName(adapterId), readerParams.getIndex().getName()), adapterId, ranges, rowTransformer, new ClientVisibilityFilter(authorizations), DataStoreUtils.isMergingIteratorRequired(readerParams, visibilityEnabled), async, RedisUtils.isGroupByRowAndIsSortByTime(readerParams, adapterId), RedisUtils.isSortByKeyRequired(readerParams), visibilityEnabled).results()).iterator();
final CloseableIterator<T>[] itArray = Iterators.toArray(it, CloseableIterator.class);
return new CloseableIteratorWrapper<>(new Closeable() {
AtomicBoolean closed = new AtomicBoolean(false);
@Override
public void close() throws IOException {
if (!closed.getAndSet(true)) {
Arrays.stream(itArray).forEach(it -> it.close());
}
}
}, Iterators.concat(itArray));
}
use of org.locationtech.geowave.core.store.operations.RangeReaderParams in project geowave by locationtech.
the class RocksDBReader method createIterator.
private CloseableIterator<T> createIterator(final RocksDBClient client, final RangeReaderParams<T> readerParams, final GeoWaveRowIteratorTransformer<T> rowTransformer, final Collection<SinglePartitionQueryRanges> ranges, final Set<String> authorizations, final boolean async) {
final Iterator<CloseableIterator> it = Arrays.stream(ArrayUtils.toObject(readerParams.getAdapterIds())).map(adapterId -> new RocksDBQueryExecution(client, RocksDBUtils.getTablePrefix(readerParams.getInternalAdapterStore().getTypeName(adapterId), readerParams.getIndex().getName()), adapterId, rowTransformer, ranges, new ClientVisibilityFilter(authorizations), DataStoreUtils.isMergingIteratorRequired(readerParams, client.isVisibilityEnabled()), async, RocksDBUtils.isGroupByRowAndIsSortByTime(readerParams, adapterId), RocksDBUtils.isSortByKeyRequired(readerParams)).results()).iterator();
final CloseableIterator<T>[] itArray = Iterators.toArray(it, CloseableIterator.class);
return new CloseableIteratorWrapper<>(new Closeable() {
AtomicBoolean closed = new AtomicBoolean(false);
@Override
public void close() throws IOException {
if (!closed.getAndSet(true)) {
Arrays.stream(itArray).forEach(it -> it.close());
}
}
}, Iterators.concat(itArray));
}
Aggregations