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;
}
Aggregations