Search in sources :

Example 1 with FileSystemDataIndexTable

use of org.locationtech.geowave.datastore.filesystem.util.FileSystemDataIndexTable in project geowave by locationtech.

the class FileSystemReader method createIteratorForDataIndexReader.

private Iterator<GeoWaveRow> createIteratorForDataIndexReader(final FileSystemClient client, final DataIndexReaderParams dataIndexReaderParams) {
    final FileSystemDataIndexTable dataIndexTable = FileSystemUtils.getDataIndexTable(client, dataIndexReaderParams.getAdapterId(), dataIndexReaderParams.getInternalAdapterStore().getTypeName(dataIndexReaderParams.getAdapterId()));
    Iterator<GeoWaveRow> iterator;
    if (dataIndexReaderParams.getDataIds() != null) {
        iterator = dataIndexTable.dataIndexIterator(dataIndexReaderParams.getDataIds());
    } else {
        iterator = dataIndexTable.dataIndexIterator(dataIndexReaderParams.getStartInclusiveDataId(), dataIndexReaderParams.getEndInclusiveDataId());
    }
    if (client.isVisibilityEnabled()) {
        Stream<GeoWaveRow> stream = Streams.stream(iterator);
        final Set<String> authorizations = Sets.newHashSet(dataIndexReaderParams.getAdditionalAuthorizations());
        stream = stream.filter(new ClientVisibilityFilter(authorizations));
        iterator = stream.iterator();
    }
    return iterator;
}
Also used : GeoWaveRow(org.locationtech.geowave.core.store.entities.GeoWaveRow) FileSystemDataIndexTable(org.locationtech.geowave.datastore.filesystem.util.FileSystemDataIndexTable) ClientVisibilityFilter(org.locationtech.geowave.core.store.query.filter.ClientVisibilityFilter)

Example 2 with FileSystemDataIndexTable

use of org.locationtech.geowave.datastore.filesystem.util.FileSystemDataIndexTable in project geowave by locationtech.

the class FileSystemOperations method deleteRowsFromDataIndex.

public void deleteRowsFromDataIndex(final byte[][] dataIds, final short adapterId, final String typeName) {
    final FileSystemDataIndexTable table = FileSystemUtils.getDataIndexTable(client, adapterId, typeName);
    Arrays.stream(dataIds).forEach(d -> table.deleteDataId(d));
}
Also used : FileSystemDataIndexTable(org.locationtech.geowave.datastore.filesystem.util.FileSystemDataIndexTable)

Aggregations

FileSystemDataIndexTable (org.locationtech.geowave.datastore.filesystem.util.FileSystemDataIndexTable)2 GeoWaveRow (org.locationtech.geowave.core.store.entities.GeoWaveRow)1 ClientVisibilityFilter (org.locationtech.geowave.core.store.query.filter.ClientVisibilityFilter)1