Search in sources :

Example 16 with GridDhtPartitionFullMap

use of org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap in project ignite by apache.

the class CacheExchangeMessageDuplicatedStateTest method checkFullMessage.

/**
     * @param cache1 Cache 1.
     * @param cache2 Cache 2.
     * @param dupPartsData Duplicated data map.
     * @param msg Message.
     */
private void checkFullMessage(String cache1, String cache2, Map<Integer, Integer> dupPartsData, GridDhtPartitionsFullMessage msg) {
    Integer cacheId;
    Integer dupCacheId;
    if (dupPartsData.containsKey(CU.cacheId(cache1))) {
        cacheId = CU.cacheId(cache1);
        dupCacheId = CU.cacheId(cache2);
    } else {
        cacheId = CU.cacheId(cache2);
        dupCacheId = CU.cacheId(cache1);
    }
    assertTrue(dupPartsData.containsKey(cacheId));
    assertEquals(dupCacheId, dupPartsData.get(cacheId));
    assertFalse(dupPartsData.containsKey(dupCacheId));
    Map<Integer, GridDhtPartitionFullMap> parts = msg.partitions();
    GridDhtPartitionFullMap emptyFullMap = parts.get(cacheId);
    for (GridDhtPartitionMap map : emptyFullMap.values()) assertEquals(0, map.map().size());
    GridDhtPartitionFullMap fullMap = parts.get(dupCacheId);
    for (GridDhtPartitionMap map : fullMap.values()) assertFalse(map.map().isEmpty());
}
Also used : GridDhtPartitionMap(org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap) GridDhtPartitionFullMap(org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap)

Aggregations

GridDhtPartitionFullMap (org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap)16 GridDhtPartitionMap (org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap)12 UUID (java.util.UUID)9 HashMap (java.util.HashMap)8 Map (java.util.Map)7 ClusterNode (org.apache.ignite.cluster.ClusterNode)5 ArrayList (java.util.ArrayList)4 List (java.util.List)3 Ignite (org.apache.ignite.Ignite)3 AffinityTopologyVersion (org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion)3 T2 (org.apache.ignite.internal.util.typedef.T2)3 Nullable (org.jetbrains.annotations.Nullable)3 NavigableMap (java.util.NavigableMap)2 Set (java.util.Set)2 TreeMap (java.util.TreeMap)2 ConcurrentMap (java.util.concurrent.ConcurrentMap)2 ConcurrentSkipListMap (java.util.concurrent.ConcurrentSkipListMap)2 GridDhtPartitionExchangeId (org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionExchangeId)2 HashSet (java.util.HashSet)1 IgniteLogger (org.apache.ignite.IgniteLogger)1