Search in sources :

Example 1 with LuceneIndexFactorySpy

use of org.apache.geode.cache.lucene.internal.LuceneIndexFactorySpy in project geode by apache.

the class LuceneQueriesAccessorBase method addCallbackToMovePrimaryOnQuery.

protected void addCallbackToMovePrimaryOnQuery(VM vm, final DistributedMember destination) {
    vm.invoke(() -> {
        LuceneIndexFactorySpy factorySpy = LuceneIndexFactorySpy.injectSpy();
        factorySpy.setGetRespositoryConsumer(doOnce(key -> moveBucket(destination, key)));
    });
}
Also used : PartitionRegionHelper(org.apache.geode.cache.partition.PartitionRegionHelper) BecomePrimaryBucketResponse(org.apache.geode.internal.cache.partitioned.BecomePrimaryBucketMessage.BecomePrimaryBucketResponse) InternalDistributedMember(org.apache.geode.distributed.internal.membership.InternalDistributedMember) HashMap(java.util.HashMap) Host(org.apache.geode.test.dunit.Host) VM(org.apache.geode.test.dunit.VM) Cache(org.apache.geode.cache.Cache) InitialImageOperation(org.apache.geode.internal.cache.InitialImageOperation) Region(org.apache.geode.cache.Region) Map(java.util.Map) RebalanceResults(org.apache.geode.cache.control.RebalanceResults) INDEX_NAME(org.apache.geode.cache.lucene.test.LuceneTestUtilities.INDEX_NAME) DEFAULT_FIELD(org.apache.geode.cache.lucene.test.LuceneTestUtilities.DEFAULT_FIELD) Assert.fail(org.junit.Assert.fail) DistributedMember(org.apache.geode.distributed.DistributedMember) Assert.assertNotNull(org.junit.Assert.assertNotNull) LuceneIndexFactorySpy(org.apache.geode.cache.lucene.internal.LuceneIndexFactorySpy) Collection(java.util.Collection) IndexRepositorySpy.doOnce(org.apache.geode.cache.lucene.test.IndexRepositorySpy.doOnce) Assert.assertTrue(org.junit.Assert.assertTrue) LuceneIndexImpl(org.apache.geode.cache.lucene.internal.LuceneIndexImpl) REGION_NAME(org.apache.geode.cache.lucene.test.LuceneTestUtilities.REGION_NAME) BecomePrimaryBucketMessage(org.apache.geode.internal.cache.partitioned.BecomePrimaryBucketMessage) Serializable(java.io.Serializable) TimeUnit(java.util.concurrent.TimeUnit) List(java.util.List) PartitionedRegion(org.apache.geode.internal.cache.PartitionedRegion) RebalanceOperation(org.apache.geode.cache.control.RebalanceOperation) Assert.assertEquals(org.junit.Assert.assertEquals) IndexRepositorySpy(org.apache.geode.cache.lucene.test.IndexRepositorySpy) LuceneIndexFactorySpy(org.apache.geode.cache.lucene.internal.LuceneIndexFactorySpy)

Aggregations

Serializable (java.io.Serializable)1 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 TimeUnit (java.util.concurrent.TimeUnit)1 Cache (org.apache.geode.cache.Cache)1 Region (org.apache.geode.cache.Region)1 RebalanceOperation (org.apache.geode.cache.control.RebalanceOperation)1 RebalanceResults (org.apache.geode.cache.control.RebalanceResults)1 LuceneIndexFactorySpy (org.apache.geode.cache.lucene.internal.LuceneIndexFactorySpy)1 LuceneIndexImpl (org.apache.geode.cache.lucene.internal.LuceneIndexImpl)1 IndexRepositorySpy (org.apache.geode.cache.lucene.test.IndexRepositorySpy)1 IndexRepositorySpy.doOnce (org.apache.geode.cache.lucene.test.IndexRepositorySpy.doOnce)1 DEFAULT_FIELD (org.apache.geode.cache.lucene.test.LuceneTestUtilities.DEFAULT_FIELD)1 INDEX_NAME (org.apache.geode.cache.lucene.test.LuceneTestUtilities.INDEX_NAME)1 REGION_NAME (org.apache.geode.cache.lucene.test.LuceneTestUtilities.REGION_NAME)1 PartitionRegionHelper (org.apache.geode.cache.partition.PartitionRegionHelper)1 DistributedMember (org.apache.geode.distributed.DistributedMember)1 InternalDistributedMember (org.apache.geode.distributed.internal.membership.InternalDistributedMember)1