use of org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtAffinityAssignmentRequest 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