use of org.apache.geode.cache.lucene.test.IndexRepositorySpy in project geode by apache.
the class LuceneQueriesAccessorBase method addCallbackToMoveBucket.
protected void addCallbackToMoveBucket(VM vm, final DistributedMember destination) {
vm.invoke(() -> {
IndexRepositorySpy spy = IndexRepositorySpy.injectSpy();
spy.beforeWriteIndexRepository(doOnce(key -> moveBucket(destination, key)));
});
}
use of org.apache.geode.cache.lucene.test.IndexRepositorySpy in project geode by apache.
the class LuceneQueriesAccessorBase method addCallbackToTriggerRebalance.
protected void addCallbackToTriggerRebalance(VM vm) {
vm.invoke(() -> {
IndexRepositorySpy spy = IndexRepositorySpy.injectSpy();
spy.beforeWriteIndexRepository(doOnce(key -> rebalanceRegion(vm)));
});
}
use of org.apache.geode.cache.lucene.test.IndexRepositorySpy in project geode by apache.
the class LuceneQueriesAccessorBase method addCallbackToMovePrimary.
protected void addCallbackToMovePrimary(VM vm, final DistributedMember destination) {
vm.invoke(() -> {
IndexRepositorySpy spy = IndexRepositorySpy.injectSpy();
spy.beforeWriteIndexRepository(doOnce(key -> movePrimary(destination, key)));
});
}
use of org.apache.geode.cache.lucene.test.IndexRepositorySpy in project geode by apache.
the class RebalanceWithRedundancyDUnitTest method returnCorrectResultsWhenCloseCacheHappensOnIndexUpdate.
@Test
@Parameters(method = "getListOfRegionTestTypes")
public void returnCorrectResultsWhenCloseCacheHappensOnIndexUpdate(RegionTestableType regionTestType) throws InterruptedException {
dataStore1.invoke(() -> {
IndexRepositorySpy spy = IndexRepositorySpy.injectSpy();
spy.beforeWriteIndexRepository(doAfterN(key -> getCache().close(), 2));
});
final String expectedExceptions = CacheClosedException.class.getName();
dataStore1.invoke(addExceptionTag1(expectedExceptions));
putEntriesAndValidateResultsWithRedundancy(regionTestType);
// Wait until the cache is closed in datastore1
dataStore1.invoke(() -> Awaitility.await().atMost(60, TimeUnit.SECONDS).until(basicGetCache()::isClosed));
}
Aggregations