Search in sources :

Example 1 with GridDhtPreloader

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

the class GridDhtTransactionalCacheAdapter method start.

/** {@inheritDoc} */
@Override
public void start() throws IgniteCheckedException {
    super.start();
    preldr = new GridDhtPreloader(ctx);
    preldr.start();
    ctx.io().addHandler(ctx.cacheId(), GridNearGetRequest.class, new CI2<UUID, GridNearGetRequest>() {

        @Override
        public void apply(UUID nodeId, GridNearGetRequest req) {
            processNearGetRequest(nodeId, req);
        }
    });
    ctx.io().addHandler(ctx.cacheId(), GridNearSingleGetRequest.class, new CI2<UUID, GridNearSingleGetRequest>() {

        @Override
        public void apply(UUID nodeId, GridNearSingleGetRequest req) {
            processNearSingleGetRequest(nodeId, req);
        }
    });
    ctx.io().addHandler(ctx.cacheId(), GridNearLockRequest.class, new CI2<UUID, GridNearLockRequest>() {

        @Override
        public void apply(UUID nodeId, GridNearLockRequest req) {
            processNearLockRequest(nodeId, req);
        }
    });
    ctx.io().addHandler(ctx.cacheId(), GridDhtLockRequest.class, new CI2<UUID, GridDhtLockRequest>() {

        @Override
        public void apply(UUID nodeId, GridDhtLockRequest req) {
            processDhtLockRequest(nodeId, req);
        }
    });
    ctx.io().addHandler(ctx.cacheId(), GridDhtLockResponse.class, new CI2<UUID, GridDhtLockResponse>() {

        @Override
        public void apply(UUID nodeId, GridDhtLockResponse req) {
            processDhtLockResponse(nodeId, req);
        }
    });
    ctx.io().addHandler(ctx.cacheId(), GridNearUnlockRequest.class, new CI2<UUID, GridNearUnlockRequest>() {

        @Override
        public void apply(UUID nodeId, GridNearUnlockRequest req) {
            processNearUnlockRequest(nodeId, req);
        }
    });
    ctx.io().addHandler(ctx.cacheId(), GridDhtUnlockRequest.class, new CI2<UUID, GridDhtUnlockRequest>() {

        @Override
        public void apply(UUID nodeId, GridDhtUnlockRequest req) {
            processDhtUnlockRequest(nodeId, req);
        }
    });
}
Also used : GridNearLockRequest(org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockRequest) GridNearUnlockRequest(org.apache.ignite.internal.processors.cache.distributed.near.GridNearUnlockRequest) GridDhtPreloader(org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader) GridNearSingleGetRequest(org.apache.ignite.internal.processors.cache.distributed.near.GridNearSingleGetRequest) GridNearGetRequest(org.apache.ignite.internal.processors.cache.distributed.near.GridNearGetRequest) UUID(java.util.UUID)

Example 2 with GridDhtPreloader

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

the class CacheGroupContext method initializeIO.

/**
 * Initializes affinity and rebalance I/O handlers.
 */
private void initializeIO() throws IgniteCheckedException {
    assert !recoveryMode.get() : "Couldn't initialize I/O handlers, recovery mode is on for group " + this;
    if (ccfg.getCacheMode() != LOCAL) {
        if (!ctx.kernalContext().clientNode()) {
            ctx.io().addCacheGroupHandler(groupId(), GridDhtAffinityAssignmentRequest.class, (IgniteBiInClosure<UUID, GridDhtAffinityAssignmentRequest>) this::processAffinityAssignmentRequest);
        }
        preldr = new GridDhtPreloader(this);
        preldr.start();
    } else
        preldr = new GridCachePreloaderAdapter(this);
}
Also used : IgniteBiInClosure(org.apache.ignite.lang.IgniteBiInClosure) GridDhtPreloader(org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader)

Aggregations

GridDhtPreloader (org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader)2 UUID (java.util.UUID)1 GridNearGetRequest (org.apache.ignite.internal.processors.cache.distributed.near.GridNearGetRequest)1 GridNearLockRequest (org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockRequest)1 GridNearSingleGetRequest (org.apache.ignite.internal.processors.cache.distributed.near.GridNearSingleGetRequest)1 GridNearUnlockRequest (org.apache.ignite.internal.processors.cache.distributed.near.GridNearUnlockRequest)1 IgniteBiInClosure (org.apache.ignite.lang.IgniteBiInClosure)1