/** * @param ctx0 Cache context. * @param key Key. * @return {@code True} if need to replicate this value. */ public boolean needDrReplicate(GridCacheContext ctx0, KeyCacheObject key) { return ctx0.isDrEnabled() && !key.internal(); }
/** * @param part Partition ID. */ public void onPartitionEvicted(int part) { List<GridCacheContext> caches = this.caches; for (GridCacheContext cctx : caches) { if (cctx.isDrEnabled()) cctx.dr().partitionEvicted(part); cctx.continuousQueries().onPartitionEvicted(part); } }
if (cctx.isDrEnabled()) { boolean drEnabled = false;
/** * @param cctx Cache context. */ private void addCacheContext(GridCacheContext cctx) { assert cacheType.userCache() == cctx.userCache() : cctx.name(); assert grpId == cctx.groupId() : cctx.name(); final boolean add; synchronized (this) { List<GridCacheContext> copy = new ArrayList<>(caches); assert sharedGroup() || copy.isEmpty(); add = copy.add(cctx); caches = Collections.unmodifiableList(copy); } assert add : cctx.name(); if (!qryEnabled && QueryUtils.isEnabled(cctx.config())) qryEnabled = true; if (!drEnabled && cctx.isDrEnabled()) drEnabled = true; }
/** * Perform DR if needed. * * @param drType DR type. * @param val Value. * @param ver Version. * @param topVer Topology version. * @throws IgniteCheckedException In case of exception. */ private void drReplicate(GridDrType drType, @Nullable CacheObject val, GridCacheVersion ver, AffinityTopologyVersion topVer) throws IgniteCheckedException { if (cctx.isDrEnabled() && drType != DR_NONE && !isInternal()) cctx.dr().replicate(key, val, rawTtl(), rawExpireTime(), ver.conflictVersion(), drType, topVer); }
/** {@inheritDoc} */ @Override public void localLoad(Collection<? extends K> keys, final ExpiryPolicy plc, final boolean keepBinary) throws IgniteCheckedException { if (ctx.store().isLocal()) { super.localLoad(keys, plc, keepBinary); return; } // Version for all loaded entries. final AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion(); final GridCacheVersion ver0 = ctx.shared().versions().nextForLoad(topVer); final boolean replicate = ctx.isDrEnabled(); final ExpiryPolicy plc0 = plc != null ? plc : ctx.expiry(); Collection<KeyCacheObject> keys0 = ctx.cacheKeysView(keys); ctx.store().loadAll(null, keys0, new CI2<KeyCacheObject, Object>() { @Override public void apply(KeyCacheObject key, Object val) { loadEntry(key, val, ver0, null, topVer, replicate, plc0); } }); }
if (ctx0.isDrEnabled()) { ctx0.dr().replicate(e.key(), e.value(), e.ttl(), e.expireTime(), e.version(), tx.local() ? DR_PRIMARY : DR_BACKUP, e.topologyVersion());
boolean replicate = cctx.isDrEnabled();
/** {@inheritDoc} */ @Override public void localLoadCache(final IgniteBiPredicate<K, V> p, Object[] args) throws IgniteCheckedException { if (ctx.store().isLocal()) { super.localLoadCache(p, args); return; } //TODO IGNITE-7954 MvccUtils.verifyMvccOperationSupport(ctx, "Load"); final AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion(); // Version for all loaded entries. final GridCacheVersion ver0 = ctx.shared().versions().nextForLoad(topVer); final boolean replicate = ctx.isDrEnabled(); CacheOperationContext opCtx = ctx.operationContextPerCall(); ExpiryPolicy plc0 = opCtx != null ? opCtx.expiry() : null; final ExpiryPolicy plc = plc0 != null ? plc0 : ctx.expiry(); if (p != null) ctx.kernalContext().resource().injectGeneric(p); try { ctx.store().loadCache(new CI3<KeyCacheObject, Object, GridCacheVersion>() { @Override public void apply(KeyCacheObject key, Object val, @Nullable GridCacheVersion ver) { assert ver == null; loadEntry(key, val, ver0, p, topVer, replicate, plc); } }, args); } finally { if (p instanceof PlatformCacheEntryFilter) ((PlatformCacheEntryFilter)p).onClose(); } }
final boolean replicate = ctx.isDrEnabled(); final AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion();
GridCacheContext drCacheCtx = cacheCtx.isNear() ? cacheCtx.near().dht().context() : cacheCtx; if (drCacheCtx.isDrEnabled()) { try { drCacheCtx.dr().onExchange(res, exchId.isLeft(), activateCluster());
GridCacheEntryEx entry = cache0.entryEx(info.key()); GridDrType drType = cacheCtx.isDrEnabled() ? GridDrType.DR_PRELOAD : GridDrType.DR_NONE;
locked, ver, ctx.isDrEnabled(), taskName, expiry, locked, ver, ctx.isDrEnabled(), taskName, expiry,
final boolean replicate = ctx.isDrEnabled(); final AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion();
boolean replicate = ctx.isDrEnabled();
GridCacheContext cacheCtx = txEntry.context(); boolean replicate = cacheCtx.isDrEnabled();
true, topVer, cctx.isDrEnabled() ? DR_PRELOAD : DR_NONE, false )) {
/** * @param ctx0 Cache context. * @param key Key. * @return {@code True} if need to replicate this value. */ public boolean needDrReplicate(GridCacheContext ctx0, KeyCacheObject key) { return ctx0.isDrEnabled() && !key.internal(); }
GridCacheContext cacheCtx = txEntry.context(); GridDrType drType = cacheCtx.isDrEnabled() ? DR_PRIMARY : DR_NONE;
/** * @param part Partition ID. */ public void onPartitionEvicted(int part) { List<GridCacheContext> caches = this.caches; for (int i = 0; i < caches.size(); i++) { GridCacheContext cctx = caches.get(i); if (cctx.isDrEnabled()) cctx.dr().partitionEvicted(part); cctx.continuousQueries().onPartitionEvicted(part); } }