use of org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopologyImpl in project ignite by apache.
the class GridCacheRebalancingPartitionCountersTest method checkUpdCounter.
/**
*/
private void checkUpdCounter(IgniteEx ignite, List<String> issues, HashMap<Integer, Long> partMap) {
final CacheGroupContext grpCtx = ignite.context().cache().cacheGroup(CU.cacheId(CACHE_NAME));
assertNotNull(grpCtx);
GridDhtPartitionTopologyImpl top = (GridDhtPartitionTopologyImpl) grpCtx.topology();
List<GridDhtLocalPartition> locParts = top.localPartitions();
for (GridDhtLocalPartition part : locParts) {
Long cnt = partMap.get(part.id());
if (cnt == null)
partMap.put(part.id(), part.updateCounter());
if ((cnt != null && part.updateCounter() != cnt) || part.updateCounter() == 0)
issues.add("Node name " + ignite.name() + "Part = " + part.id() + " updCounter " + part.updateCounter());
}
}
use of org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopologyImpl in project ignite by apache.
the class CacheGroupContext method start.
/**
* @throws IgniteCheckedException If failed.
*/
public void start() throws IgniteCheckedException {
aff = new GridAffinityAssignmentCache(ctx.kernalContext(), cacheOrGroupName(), grpId, ccfg.getAffinity(), ccfg.getNodeFilter(), ccfg.getBackups(), ccfg.getCacheMode() == LOCAL, persistenceEnabled());
if (ccfg.getCacheMode() != LOCAL) {
top = new GridDhtPartitionTopologyImpl(ctx, this);
if (!ctx.kernalContext().clientNode()) {
ctx.io().addCacheGroupHandler(groupId(), GridDhtAffinityAssignmentRequest.class, new IgniteBiInClosure<UUID, GridDhtAffinityAssignmentRequest>() {
@Override
public void apply(UUID nodeId, GridDhtAffinityAssignmentRequest msg) {
processAffinityAssignmentRequest(nodeId, msg);
}
});
}
preldr = new GridDhtPreloader(this);
preldr.start();
} else
preldr = new GridCachePreloaderAdapter(this);
evictor = new GridDhtPartitionsEvictor(this);
if (persistenceEnabled()) {
try {
offheapMgr = new GridCacheOffheapManager();
} catch (Exception e) {
throw new IgniteCheckedException("Failed to initialize offheap manager", e);
}
} else
offheapMgr = new IgniteCacheOffheapManagerImpl();
offheapMgr.start(ctx, this);
ctx.affinity().onCacheGroupCreated(this);
}
Aggregations