@Test @Override public void testDeleteByQuery() throws Exception { Query<String, WebPage> query; WebPageDataCreator.createWebPageData(webPageStore); query = webPageStore.newQuery(); DataStoreTestUtil.assertNumResults(webPageStore.newQuery(), URLS.length); webPageStore.deleteByQuery(query); webPageStore.flush(); DataStoreTestUtil.assertEmptyResults(webPageStore.newQuery()); WebPageDataCreator.createWebPageData(webPageStore); query = webPageStore.newQuery(); query.setFields(AvroUtils.getSchemaFieldNames(WebPage.SCHEMA$)); DataStoreTestUtil.assertNumResults(webPageStore.newQuery(), URLS.length); webPageStore.deleteByQuery(query); webPageStore.flush(); DataStoreTestUtil.assertEmptyResults(webPageStore.newQuery()); webPageStore.truncateSchema(); }
@Override public long deleteByQuery(Query<K, T> query) throws GoraException { int deleteCount = 0; try { Result<K, T> result = query.execute(); while (result.next()) { if (aerospikeClient.delete(null, getAerospikeKey(result.getKey()))) { deleteCount++; } } return deleteCount; } catch (Exception e) { throw new GoraException(e); } }
AerospikeStore extends DataStoreBase<K, T> { @Override public long deleteByQuery(Query<K, T> query) throws GoraException { int deleteCount = 0; try { Result<K, T> result = query.execute(); while (result.next()) { if (aerospikeClient.delete(null, getAerospikeKey(result.getKey()))) { deleteCount++; } } return deleteCount; } catch (Exception e) { throw new GoraException(e); } } }
AerospikeStore extends DataStoreBase<K, T> { @Override public long deleteByQuery(Query<K, T> query) throws GoraException { int deleteCount = 0; try { Result<K, T> result = query.execute(); while (result.next()) { if (aerospikeClient.delete(null, getAerospikeKey(result.getKey()))) { deleteCount++; } } return deleteCount; } catch (Exception e) { throw new GoraException(e); } }  }
AerospikeStore extends DataStoreBase<K, T> { @Override public long deleteByQuery(Query<K, T> query) throws GoraException { int deleteCount = 0; try { Result<K, T> result = query.execute(); while (result.next()) { if (aerospikeClient.delete(null, getAerospikeKey(result.getKey()))) { deleteCount++; } } return deleteCount; } catch (Exception e) { throw new GoraException(e); } }  @Override void initialize(Class<K> keyClass, Class<T> persistentClass, Properties properties); @Override String getSchemaName(); @Override void createSchema(); @Override void deleteSchema(); @Override boolean schemaExists(); @Override T get(K key, String[] fields); @Override boolean exists(K key); @Override void put(K key, T persistent); @Override boolean delete(K key); @Override long deleteByQuery(Query<K, T> query); @Override Result<K, T> execute(Query<K, T> query); @Override Query<K, T> newQuery(); @Override List<PartitionQuery<K, T>> getPartitions(Query<K, T> query); @Override void flush(); @Override void close(); T createPersistentInstance(Record record, String[] fields); }
AerospikeStore extends DataStoreBase<K, T> { @Override public long deleteByQuery(Query<K, T> query) throws GoraException { int deleteCount = 0; try { Result<K, T> result = query.execute(); while (result.next()) { if (aerospikeClient.delete(null, getAerospikeKey(result.getKey()))) { deleteCount++; } } return deleteCount; } catch (Exception e) { throw new GoraException(e); } }  @Override void initialize(Class<K> keyClass, Class<T> persistentClass, Properties properties); @Override String getSchemaName(); @Override void createSchema(); @Override void deleteSchema(); @Override boolean schemaExists(); @Override T get(K key, String[] fields); @Override boolean exists(K key); @Override void put(K key, T persistent); @Override boolean delete(K key); @Override long deleteByQuery(Query<K, T> query); @Override Result<K, T> execute(Query<K, T> query); @Override Query<K, T> newQuery(); @Override List<PartitionQuery<K, T>> getPartitions(Query<K, T> query); @Override void flush(); @Override void close(); T createPersistentInstance(Record record, String[] fields);  }