Search in sources :

Example 1 with GridDhtPartitionsEvictor

use of org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionsEvictor 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);
}
Also used : GridDhtAffinityAssignmentRequest(org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtAffinityAssignmentRequest) GridCacheOffheapManager(org.apache.ignite.internal.processors.cache.persistence.GridCacheOffheapManager) IgniteClientDisconnectedCheckedException(org.apache.ignite.internal.IgniteClientDisconnectedCheckedException) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) GridDhtPreloader(org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) GridDhtPartitionsEvictor(org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionsEvictor) GridAffinityAssignmentCache(org.apache.ignite.internal.processors.affinity.GridAffinityAssignmentCache) UUID(java.util.UUID) GridDhtPartitionTopologyImpl(org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopologyImpl)

Aggregations

UUID (java.util.UUID)1 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 IgniteClientDisconnectedCheckedException (org.apache.ignite.internal.IgniteClientDisconnectedCheckedException)1 GridAffinityAssignmentCache (org.apache.ignite.internal.processors.affinity.GridAffinityAssignmentCache)1 GridDhtAffinityAssignmentRequest (org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtAffinityAssignmentRequest)1 GridDhtPartitionTopologyImpl (org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopologyImpl)1 GridDhtPartitionsEvictor (org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionsEvictor)1 GridDhtPreloader (org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader)1 GridCacheOffheapManager (org.apache.ignite.internal.processors.cache.persistence.GridCacheOffheapManager)1