Search in sources :

Example 1 with AccumuloDataStore

use of org.locationtech.geowave.datastore.accumulo.AccumuloDataStore 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)

Aggregations

IndexStore (org.locationtech.geowave.core.store.index.IndexStore)1 IndexStoreImpl (org.locationtech.geowave.core.store.metadata.IndexStoreImpl)1 AccumuloDataStore (org.locationtech.geowave.datastore.accumulo.AccumuloDataStore)1 AccumuloOptions (org.locationtech.geowave.datastore.accumulo.config.AccumuloOptions)1 AccumuloOperations (org.locationtech.geowave.datastore.accumulo.operations.AccumuloOperations)1