Search in sources :

Example 1 with GridCacheAffinityImpl

use of org.apache.ignite.internal.processors.cache.affinity.GridCacheAffinityImpl in project ignite by apache.

the class GridAffinityNoCacheSelfTest method checkAffinityImplCacheDeleted.

/**
 * @param key Key.
 */
private void checkAffinityImplCacheDeleted(Object key) throws InterruptedException {
    IgniteEx grid = grid(0);
    final String cacheName = "cacheToBeDeleted";
    grid(1).getOrCreateCache(cacheName);
    awaitPartitionMapExchange();
    Affinity<Object> affinity = grid.affinity(cacheName);
    assertTrue(affinity instanceof GridCacheAffinityImpl);
    final ClusterNode n = grid.cluster().localNode();
    grid.cache(cacheName).destroy();
    awaitPartitionMapExchange();
    assertAffinityMethodsException(grid.affinity(cacheName), key, n);
}
Also used : ClusterNode(org.apache.ignite.cluster.ClusterNode) CacheObject(org.apache.ignite.internal.processors.cache.CacheObject) GridCacheAffinityImpl(org.apache.ignite.internal.processors.cache.affinity.GridCacheAffinityImpl)

Example 2 with GridCacheAffinityImpl

use of org.apache.ignite.internal.processors.cache.affinity.GridCacheAffinityImpl in project ignite by apache.

the class GridAffinityNoCacheSelfTest method checkAffinityProxyNoCache.

/**
 * @param key Key.
 */
private void checkAffinityProxyNoCache(Object key) {
    IgniteEx ignite = grid(0);
    final Affinity<Object> affinity = ignite.affinity("noCache");
    assertFalse("Affinity proxy instance expected", affinity instanceof GridCacheAffinityImpl);
    final ClusterNode n = ignite.cluster().localNode();
    assertAffinityMethodsException(affinity, key, n);
}
Also used : ClusterNode(org.apache.ignite.cluster.ClusterNode) CacheObject(org.apache.ignite.internal.processors.cache.CacheObject) GridCacheAffinityImpl(org.apache.ignite.internal.processors.cache.affinity.GridCacheAffinityImpl)

Aggregations

ClusterNode (org.apache.ignite.cluster.ClusterNode)2 CacheObject (org.apache.ignite.internal.processors.cache.CacheObject)2 GridCacheAffinityImpl (org.apache.ignite.internal.processors.cache.affinity.GridCacheAffinityImpl)2