Search in sources :

Example 1 with RocksDBDataIndexTable

use of org.locationtech.geowave.datastore.rocksdb.util.RocksDBDataIndexTable in project geowave by locationtech.

the class RocksDBOperations method deleteRowsFromDataIndex.

public void deleteRowsFromDataIndex(final byte[][] dataIds, final short adapterId, final String typeName) {
    final RocksDBDataIndexTable table = RocksDBUtils.getDataIndexTable(getClient(), typeName, adapterId);
    Arrays.stream(dataIds).forEach(d -> table.delete(d));
    table.flush();
}
Also used : RocksDBDataIndexTable(org.locationtech.geowave.datastore.rocksdb.util.RocksDBDataIndexTable)

Example 2 with RocksDBDataIndexTable

use of org.locationtech.geowave.datastore.rocksdb.util.RocksDBDataIndexTable in project geowave by locationtech.

the class RocksDBReader method createIteratorForDataIndexReader.

private Iterator<GeoWaveRow> createIteratorForDataIndexReader(final RocksDBClient client, final DataIndexReaderParams dataIndexReaderParams) {
    final RocksDBDataIndexTable dataIndexTable = RocksDBUtils.getDataIndexTable(client, dataIndexReaderParams.getInternalAdapterStore().getTypeName(dataIndexReaderParams.getAdapterId()), dataIndexReaderParams.getAdapterId());
    Iterator<GeoWaveRow> iterator;
    if (dataIndexReaderParams.getDataIds() != null) {
        iterator = dataIndexTable.dataIndexIterator(dataIndexReaderParams.getDataIds());
    } else {
        iterator = dataIndexTable.dataIndexIterator(dataIndexReaderParams.getStartInclusiveDataId(), dataIndexReaderParams.getEndInclusiveDataId(), dataIndexReaderParams.isReverse());
    }
    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 : RocksDBDataIndexTable(org.locationtech.geowave.datastore.rocksdb.util.RocksDBDataIndexTable) GeoWaveRow(org.locationtech.geowave.core.store.entities.GeoWaveRow) ClientVisibilityFilter(org.locationtech.geowave.core.store.query.filter.ClientVisibilityFilter)

Aggregations

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