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());
}
Aggregations