use of org.apache.ignite.internal.processors.cache.GridCacheContext in project ignite by apache.
the class GridNearAtomicSingleUpdateFilterRequest method prepareMarshal.
/**
* {@inheritDoc}
*/
@Override
public void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException {
super.prepareMarshal(ctx);
GridCacheContext cctx = ctx.cacheContext(cacheId);
if (filter != null) {
boolean hasFilter = false;
for (CacheEntryPredicate p : filter) {
if (p != null) {
hasFilter = true;
p.prepareMarshal(cctx);
}
}
if (!hasFilter)
filter = null;
}
}
use of org.apache.ignite.internal.processors.cache.GridCacheContext in project ignite by apache.
the class GridDhtForceKeysResponse method prepareMarshal.
/**
* {@inheritDoc}
* @param ctx
*/
@Override
public void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException {
super.prepareMarshal(ctx);
GridCacheContext cctx = ctx.cacheContext(cacheId);
if (missedKeys != null)
prepareMarshalCacheObjects(missedKeys, cctx);
if (infos != null) {
for (GridCacheEntryInfo info : infos) info.marshal(cctx.cacheObjectContext());
}
if (err != null && errBytes == null)
errBytes = U.marshal(ctx, err);
}
use of org.apache.ignite.internal.processors.cache.GridCacheContext in project ignite by apache.
the class GridDhtTxLocalAdapter method mapExplicitLocks.
/**
* Map explicit locks.
*/
protected void mapExplicitLocks() {
if (!mapped) {
// Explicit locks may participate in implicit transactions only.
if (!implicit()) {
mapped = true;
return;
}
Map<ClusterNode, List<GridDhtCacheEntry>> dhtEntryMap = null;
Map<ClusterNode, List<GridDhtCacheEntry>> nearEntryMap = null;
for (IgniteTxEntry e : allEntries()) {
assert e.cached() != null;
GridCacheContext cacheCtx = e.cached().context();
if (cacheCtx.isNear())
continue;
if (e.cached().obsolete()) {
GridCacheEntryEx cached = cacheCtx.cache().entryEx(e.key(), topologyVersion());
e.cached(cached);
}
if (e.cached().detached() || e.cached().isLocal())
continue;
while (true) {
try {
// Map explicit locks.
if (e.explicitVersion() != null && !e.explicitVersion().equals(xidVer)) {
if (dhtEntryMap == null)
dhtEntryMap = new GridLeanMap<>();
if (nearEntryMap == null)
nearEntryMap = new GridLeanMap<>();
cacheCtx.dhtMap((GridDhtCacheEntry) e.cached(), e.explicitVersion(), log, dhtEntryMap, nearEntryMap);
}
break;
} catch (GridCacheEntryRemovedException ignore) {
GridCacheEntryEx cached = cacheCtx.cache().entryEx(e.key(), topologyVersion());
e.cached(cached);
}
}
}
if (!F.isEmpty(dhtEntryMap))
addDhtNodeEntryMapping(dhtEntryMap);
if (!F.isEmpty(nearEntryMap))
addNearNodeEntryMapping(nearEntryMap);
mapped = true;
}
}
use of org.apache.ignite.internal.processors.cache.GridCacheContext in project ignite by apache.
the class GridDhtLockResponse method finishUnmarshal.
/**
* {@inheritDoc}
*/
@Override
public void finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException {
super.finishUnmarshal(ctx, ldr);
GridCacheContext cctx = ctx.cacheContext(cacheId);
if (nearEvicted != null) {
for (IgniteTxKey key : nearEvicted) key.finishUnmarshal(cctx, ldr);
}
if (preloadEntries != null)
unmarshalInfos(preloadEntries, ctx.cacheContext(cacheId), ldr);
}
use of org.apache.ignite.internal.processors.cache.GridCacheContext in project ignite by apache.
the class GridDhtLockResponse method prepareMarshal.
/**
* {@inheritDoc}
* @param ctx
*/
@Override
public void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException {
super.prepareMarshal(ctx);
GridCacheContext cctx = ctx.cacheContext(cacheId);
if (nearEvicted != null) {
for (IgniteTxKey key : nearEvicted) key.prepareMarshal(cctx);
}
if (preloadEntries != null)
marshalInfos(preloadEntries, cctx.shared(), cctx.cacheObjectContext());
}
Aggregations