/** {@inheritDoc} */ @Override protected void onKernalStart0() throws IgniteCheckedException { try { queueHdrView = cctx.cache(); initFlag = true; } finally { initLatch.countDown(); } }
/** {@inheritDoc} */ @Override public void onActivate(GridKernalContext kctx) throws IgniteCheckedException { this.ctx = kctx.cache().<GridCacheInternalKey, V>context().cacheContext(ctx.cacheId()); this.cacheView = ctx.cache(); }
/** {@inheritDoc} */ @Override public void awaitLastFuture(GridCacheSharedContext ctx) { if (cacheCtx == null) return; cacheCtx.cache().awaitLastFut(); }
/** * @return Preloader. */ public GridCachePreloader preloader() { return cache().preloader(); }
/** {@inheritDoc} */ @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { ctx = (GridCacheContext<K, V>)in.readObject(); delegate = (IgniteInternalCache<K, V>)in.readObject(); opCtx = (CacheOperationContext)in.readObject(); gate = ctx.gate(); aff = new GridCacheAffinityProxy<>(ctx, ctx.cache().affinity()); }
/** * Gets cache entry for given key. * * @param cacheCtx Cache context. * @param key Key. * @return Cache entry. */ protected GridCacheEntryEx entryEx(GridCacheContext cacheCtx, IgniteTxKey key) { return cacheCtx.cache().entryEx(key.key()); }
/** * Process fast DML operation if possible. * * @param args QUery arguments. * @return Update result or {@code null} if fast update is not applicable for plan. * @throws IgniteCheckedException If failed. */ public UpdateResult processFast(Object[] args) throws IgniteCheckedException { if (fastUpdate != null) return fastUpdate.execute(cacheContext().cache(), args); return null; }
/** {@inheritDoc} */ @Override public CacheMetricsMXBean mxBean() { GridCacheContext<K, V> ctx = getContextSafe(); return ctx.cache().clusterMxBean(); }
/** {@inheritDoc} */ @Override public CacheMetricsMXBean localMxBean() { GridCacheContext<K, V> ctx = getContextSafe(); return ctx.cache().localMxBean(); }
/** * Gets cache entry for given key and topology version. * * @param cacheCtx Cache context. * @param key Key. * @param topVer Topology version. * @return Cache entry. */ protected GridCacheEntryEx entryEx(GridCacheContext cacheCtx, IgniteTxKey key, AffinityTopologyVersion topVer) { return cacheCtx.cache().entryEx(key.key(), topVer); }
/** * @return true if current PartitionLossPolicy corresponds to *_SAFE values. */ private boolean isSafeLossPolicy() { PartitionLossPolicy lossPlc = cctx.cache().configuration().getPartitionLossPolicy(); return lossPlc == PartitionLossPolicy.READ_ONLY_SAFE || lossPlc == PartitionLossPolicy.READ_WRITE_SAFE; }
/** {@inheritDoc} */ @Override public CacheMetrics metrics() { GridCacheContext<K, V> ctx = getContextSafe(); return ctx.cache().clusterMetrics(); }
/** {@inheritDoc} */ @Override public CacheMetrics localMetrics() { GridCacheContext<K, V> ctx = getContextSafe(); return ctx.cache().localMetrics(); }
/** {@inheritDoc} */ @Override public Iterator<Cache.Entry<K, V>> iterator() { GridCacheContext<K, V> ctx = getContextSafe(); try { return ctx.cache().igniteIterator(); } catch (IgniteCheckedException | IgniteException e) { throw cacheException(e); } }
/** * Reconstructs object on unmarshalling. * * @return Reconstructed object. * @throws ObjectStreamException Thrown in case of unmarshalling error. */ private Object readResolve() throws ObjectStreamException { return cctx.grid().affinity(cctx.cache().name()); } }
/** * @param cctx Cache context. * @param stoppedCaches List where stopped cache should be added. */ private void stopCacheOnReconnect(GridCacheContext cctx, List<GridCacheAdapter> stoppedCaches) { cctx.gate().reconnected(true); sharedCtx.removeCacheContext(cctx); caches.remove(cctx.name()); completeProxyInitialize(cctx.name()); jCacheProxies.remove(cctx.name()); stoppedCaches.add(cctx.cache()); }
/** * @return {@code True} if set header found in cache. * @throws IgniteCheckedException If failed. */ @SuppressWarnings("unchecked") boolean checkHeader() throws IgniteCheckedException { IgniteInternalCache<GridCacheSetHeaderKey, GridCacheSetHeader> cache0 = ctx.cache(); GridCacheSetHeader hdr = cache0.get(new GridCacheSetHeaderKey(name)); return hdr != null && hdr.id().equals(id); }
/** * @throws IgniteCheckedException If query is invalid. */ public void validate() throws IgniteCheckedException { if ((type != SCAN && type != SET && type != SPI) && !QueryUtils.isEnabled(cctx.config())) throw new IgniteCheckedException("Indexing is disabled for cache: " + cctx.cache().name()); }
@Override public void apply(GridNearAtomicAbstractUpdateRequest req, GridNearAtomicUpdateResponse res) { if (syncMode != FULL_ASYNC) onPrimaryResponse(res.nodeId(), res, false); else if (res.remapTopologyVersion() != null) ((GridDhtAtomicCache)cctx.cache()).remapToNewPrimary(req); } });
@Override public void applyx(GridCacheSetHeader hdr) throws IgniteCheckedException { hdr = (GridCacheSetHeader) cctx.cache().withNoRetries().getAndRemove(new GridCacheSetHeaderKey(name)); if (hdr != null) cctx.dataStructures().removeSetData(hdr.id(), hdr.separated()); } };