Search in sources :

Example 1 with IndexStoreImpl

use of org.locationtech.geowave.core.store.metadata.IndexStoreImpl in project geowave by locationtech.

the class AccumuloUtils method getEntries.

/**
 * Get number of entries per index.
 */
public static long getEntries(final BaseDataStore dataStore, final Connector connector, final String namespace, final Index index) throws AccumuloException, AccumuloSecurityException, IOException {
    long counter = 0L;
    final AccumuloOptions options = new AccumuloOptions();
    final AccumuloOperations operations = new AccumuloOperations(connector, namespace, options);
    final IndexStore indexStore = new IndexStoreImpl(operations, options);
    if (indexStore.indexExists(index.getName())) {
        try (final CloseableIterator<?> iterator = new AccumuloDataStore(operations, options).query(QueryBuilder.newBuilder().build())) {
            while (iterator.hasNext()) {
                counter++;
                iterator.next();
            }
        }
    }
    return counter;
}
Also used : IndexStoreImpl(org.locationtech.geowave.core.store.metadata.IndexStoreImpl) AccumuloOperations(org.locationtech.geowave.datastore.accumulo.operations.AccumuloOperations) AccumuloOptions(org.locationtech.geowave.datastore.accumulo.config.AccumuloOptions) AccumuloDataStore(org.locationtech.geowave.datastore.accumulo.AccumuloDataStore) IndexStore(org.locationtech.geowave.core.store.index.IndexStore)

Example 2 with IndexStoreImpl

use of org.locationtech.geowave.core.store.metadata.IndexStoreImpl in project geowave by locationtech.

the class AccumuloUtils method getIterator.

private static CloseableIterator<Entry<Key, Value>> getIterator(final Connector connector, final String namespace, final Index index) throws AccumuloException, AccumuloSecurityException, IOException, TableNotFoundException {
    CloseableIterator<Entry<Key, Value>> iterator = null;
    final AccumuloOptions options = new AccumuloOptions();
    final AccumuloOperations operations = new AccumuloOperations(connector, namespace, new AccumuloOptions());
    final IndexStore indexStore = new IndexStoreImpl(operations, options);
    final PersistentAdapterStore adapterStore = new AdapterStoreImpl(operations, options);
    final AdapterIndexMappingStore mappingStore = new AdapterIndexMappingStoreImpl(operations, options);
    if (indexStore.indexExists(index.getName())) {
        final ScannerBase scanner = operations.createBatchScanner(index.getName());
        ((BatchScanner) scanner).setRanges(AccumuloUtils.byteArrayRangesToAccumuloRanges(null));
        final IteratorSetting iteratorSettings = new IteratorSetting(10, "GEOWAVE_WHOLE_ROW_ITERATOR", WholeRowIterator.class);
        scanner.addScanIterator(iteratorSettings);
        final Iterator<Entry<Key, Value>> it = new IteratorWrapper(adapterStore, mappingStore, index, scanner.iterator(), new QueryFilter[] { new DedupeFilter() });
        iterator = new CloseableIteratorWrapper<>(new ScannerClosableWrapper(scanner), it);
    }
    return iterator;
}
Also used : AccumuloOperations(org.locationtech.geowave.datastore.accumulo.operations.AccumuloOperations) ScannerBase(org.apache.accumulo.core.client.ScannerBase) BatchScanner(org.apache.accumulo.core.client.BatchScanner) AdapterIndexMappingStore(org.locationtech.geowave.core.store.adapter.AdapterIndexMappingStore) IndexStoreImpl(org.locationtech.geowave.core.store.metadata.IndexStoreImpl) Entry(java.util.Map.Entry) PersistentAdapterStore(org.locationtech.geowave.core.store.adapter.PersistentAdapterStore) AdapterIndexMappingStoreImpl(org.locationtech.geowave.core.store.metadata.AdapterIndexMappingStoreImpl) IteratorSetting(org.apache.accumulo.core.client.IteratorSetting) CloseableIteratorWrapper(org.locationtech.geowave.core.store.CloseableIteratorWrapper) AccumuloOptions(org.locationtech.geowave.datastore.accumulo.config.AccumuloOptions) DedupeFilter(org.locationtech.geowave.core.store.query.filter.DedupeFilter) AdapterStoreImpl(org.locationtech.geowave.core.store.metadata.AdapterStoreImpl) IndexStore(org.locationtech.geowave.core.store.index.IndexStore)

Example 3 with IndexStoreImpl

use of org.locationtech.geowave.core.store.metadata.IndexStoreImpl in project geowave by locationtech.

the class BaseDataStoreFactory method createStore.

@Override
public DataStore createStore(final StoreFactoryOptions factoryOptions) {
    final DataStoreOperations operations = helper.createOperations(factoryOptions);
    final DataStoreOptions options = factoryOptions.getStoreOptions();
    return new BaseDataStore(new IndexStoreImpl(operations, options), new AdapterStoreImpl(operations, options), new DataStatisticsStoreImpl(operations, options), new AdapterIndexMappingStoreImpl(operations, options), operations, options, new InternalAdapterStoreImpl(operations), new PropertyStoreImpl(operations, options));
}
Also used : IndexStoreImpl(org.locationtech.geowave.core.store.metadata.IndexStoreImpl) DataStoreOperations(org.locationtech.geowave.core.store.operations.DataStoreOperations) AdapterIndexMappingStoreImpl(org.locationtech.geowave.core.store.metadata.AdapterIndexMappingStoreImpl) InternalAdapterStoreImpl(org.locationtech.geowave.core.store.metadata.InternalAdapterStoreImpl) BaseDataStore(org.locationtech.geowave.core.store.base.BaseDataStore) PropertyStoreImpl(org.locationtech.geowave.core.store.metadata.PropertyStoreImpl) AdapterStoreImpl(org.locationtech.geowave.core.store.metadata.AdapterStoreImpl) InternalAdapterStoreImpl(org.locationtech.geowave.core.store.metadata.InternalAdapterStoreImpl) DataStatisticsStoreImpl(org.locationtech.geowave.core.store.metadata.DataStatisticsStoreImpl)

Example 4 with IndexStoreImpl

use of org.locationtech.geowave.core.store.metadata.IndexStoreImpl in project geowave by locationtech.

the class AccumuloUtils method getIndices.

/**
 * Get list of indices associated with the given namespace
 */
public static List<Index> getIndices(final Connector connector, final String namespace) {
    final List<Index> indices = new ArrayList<>();
    final AccumuloOptions options = new AccumuloOptions();
    final IndexStore indexStore = new IndexStoreImpl(new AccumuloOperations(connector, namespace, options), options);
    try (final CloseableIterator<Index> itr = indexStore.getIndices()) {
        while (itr.hasNext()) {
            indices.add(itr.next());
        }
    }
    return indices;
}
Also used : IndexStoreImpl(org.locationtech.geowave.core.store.metadata.IndexStoreImpl) AccumuloOperations(org.locationtech.geowave.datastore.accumulo.operations.AccumuloOperations) AccumuloOptions(org.locationtech.geowave.datastore.accumulo.config.AccumuloOptions) ArrayList(java.util.ArrayList) Index(org.locationtech.geowave.core.store.api.Index) IndexStore(org.locationtech.geowave.core.store.index.IndexStore)

Example 5 with IndexStoreImpl

use of org.locationtech.geowave.core.store.metadata.IndexStoreImpl in project geowave by locationtech.

the class BigTableDataStoreFactory method createStore.

@Override
public DataStore createStore(final StoreFactoryOptions options) {
    if (!(options instanceof BigTableOptions)) {
        throw new AssertionError("Expected " + BigTableOptions.class.getSimpleName());
    }
    final BigTableOperations bigtableOperations = (BigTableOperations) helper.createOperations(options);
    final HBaseOptions hbaseOptions = ((BigTableOptions) options).getHBaseOptions();
    // BigTableDataStatisticsStore
    return new HBaseDataStore(new IndexStoreImpl(bigtableOperations, hbaseOptions), new AdapterStoreImpl(bigtableOperations, hbaseOptions), new DataStatisticsStoreImpl(bigtableOperations, hbaseOptions), new AdapterIndexMappingStoreImpl(bigtableOperations, hbaseOptions), bigtableOperations, hbaseOptions, new InternalAdapterStoreImpl(bigtableOperations), new PropertyStoreImpl(bigtableOperations, hbaseOptions));
}
Also used : HBaseDataStore(org.locationtech.geowave.datastore.hbase.HBaseDataStore) HBaseOptions(org.locationtech.geowave.datastore.hbase.config.HBaseOptions) IndexStoreImpl(org.locationtech.geowave.core.store.metadata.IndexStoreImpl) BigTableOptions(org.locationtech.geowave.datastore.bigtable.config.BigTableOptions) AdapterIndexMappingStoreImpl(org.locationtech.geowave.core.store.metadata.AdapterIndexMappingStoreImpl) InternalAdapterStoreImpl(org.locationtech.geowave.core.store.metadata.InternalAdapterStoreImpl) PropertyStoreImpl(org.locationtech.geowave.core.store.metadata.PropertyStoreImpl) BigTableOperations(org.locationtech.geowave.datastore.bigtable.operations.BigTableOperations) AdapterStoreImpl(org.locationtech.geowave.core.store.metadata.AdapterStoreImpl) InternalAdapterStoreImpl(org.locationtech.geowave.core.store.metadata.InternalAdapterStoreImpl) DataStatisticsStoreImpl(org.locationtech.geowave.core.store.metadata.DataStatisticsStoreImpl)

Aggregations

IndexStoreImpl (org.locationtech.geowave.core.store.metadata.IndexStoreImpl)5 IndexStore (org.locationtech.geowave.core.store.index.IndexStore)3 AdapterIndexMappingStoreImpl (org.locationtech.geowave.core.store.metadata.AdapterIndexMappingStoreImpl)3 AdapterStoreImpl (org.locationtech.geowave.core.store.metadata.AdapterStoreImpl)3 AccumuloOptions (org.locationtech.geowave.datastore.accumulo.config.AccumuloOptions)3 AccumuloOperations (org.locationtech.geowave.datastore.accumulo.operations.AccumuloOperations)3 DataStatisticsStoreImpl (org.locationtech.geowave.core.store.metadata.DataStatisticsStoreImpl)2 InternalAdapterStoreImpl (org.locationtech.geowave.core.store.metadata.InternalAdapterStoreImpl)2 PropertyStoreImpl (org.locationtech.geowave.core.store.metadata.PropertyStoreImpl)2 ArrayList (java.util.ArrayList)1 Entry (java.util.Map.Entry)1 BatchScanner (org.apache.accumulo.core.client.BatchScanner)1 IteratorSetting (org.apache.accumulo.core.client.IteratorSetting)1 ScannerBase (org.apache.accumulo.core.client.ScannerBase)1 CloseableIteratorWrapper (org.locationtech.geowave.core.store.CloseableIteratorWrapper)1 AdapterIndexMappingStore (org.locationtech.geowave.core.store.adapter.AdapterIndexMappingStore)1 PersistentAdapterStore (org.locationtech.geowave.core.store.adapter.PersistentAdapterStore)1 Index (org.locationtech.geowave.core.store.api.Index)1 BaseDataStore (org.locationtech.geowave.core.store.base.BaseDataStore)1 DataStoreOperations (org.locationtech.geowave.core.store.operations.DataStoreOperations)1