Skip to content

Commit

Permalink
IGNITE-10692: MVCC: Test GridCacheDhtPreloadDelayedSelfTest fails in …
Browse files Browse the repository at this point in the history
…mvcc mode. this closes #5671.
  • Loading branch information
AMashenkov authored and gvvinblade committed Jan 14, 2019
1 parent 74aa337 commit f94cbee
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.apache.ignite.events.Event;
import org.apache.ignite.events.EventType;
import org.apache.ignite.internal.IgniteKernal;
import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap;
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap;
import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader;
Expand Down Expand Up @@ -389,7 +390,10 @@ public void testPreloadManyNodes() throws Exception {
* @return Topology.
*/
private GridDhtPartitionTopology topology(Ignite g) {
return ((GridNearCacheAdapter<Integer, String>)((IgniteKernal)g).<Integer, String>internalCache(DEFAULT_CACHE_NAME)).dht().topology();
GridCacheAdapter<Integer, String> internalCache = ((IgniteKernal)g).internalCache(DEFAULT_CACHE_NAME);

return internalCache.isNear() ? ((GridNearCacheAdapter<Integer, String>)internalCache).dht().topology() :
internalCache.context().dht().topology();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.apache.ignite.cache.store.CacheStoreAdapter;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down Expand Up @@ -75,6 +76,9 @@ private CacheConfiguration cacheConfiguration() {

/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
if (MvccFeatureChecker.forcedMvcc())
fail("https://issues.apache.org/jira/browse/IGNITE-8582");

startGridsMultiThreaded(GRID_CNT);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,15 +323,19 @@ protected static <K, V> GridDhtCacheAdapter<K, V> dht(IgniteCache<K, V> cache) {
* @return DHT cache.
*/
protected <K, V> GridDhtCacheAdapter<K, V> dht() {
return this.<K, V>near().dht();
GridCacheAdapter<K, V> internalCache = ((IgniteKernal)grid()).internalCache(DEFAULT_CACHE_NAME);

return internalCache.isNear() ? internalCache.context().near().dht() : internalCache.context().dht();
}

/**
* @param idx Grid index.
* @return DHT cache.
*/
protected <K, V> GridDhtCacheAdapter<K, V> dht(int idx) {
return this.<K, V>near(idx).dht();
GridCacheAdapter<K, V> internalCache = ((IgniteKernal)grid(idx)).internalCache(DEFAULT_CACHE_NAME);

return internalCache.isNear() ? internalCache.context().near().dht() : internalCache.context().dht();
}

/**
Expand All @@ -340,7 +344,9 @@ protected <K, V> GridDhtCacheAdapter<K, V> dht(int idx) {
* @return DHT cache.
*/
protected <K, V> GridDhtCacheAdapter<K, V> dht(int idx, String cache) {
return this.<K, V>near(idx, cache).dht();
GridCacheAdapter<K, V> internalCache = ((IgniteKernal)grid(idx)).internalCache(cache);

return internalCache.isNear() ? internalCache.context().near().dht() : internalCache.context().dht();
}

/**
Expand Down

0 comments on commit f94cbee

Please sign in to comment.