/** * @param ctx Cache context. * @param map Cache concurrent map. */ public GridDhtAtomicCache(GridCacheContext<K, V> ctx, GridCacheConcurrentMap map) { super(ctx, map); msgLog = ctx.shared().atomicMessageLogger(); }
/** * @param o Object to prepare for marshalling. * @param ctx Context. * @throws IgniteCheckedException If failed. */ protected final void prepareObject(@Nullable Object o, GridCacheContext ctx) throws IgniteCheckedException { prepareObject(o, ctx.shared()); }
/** */ @NotNull private MvccCoordinator coordinator() { return cctx.shared().coordinators().currentCoordinator(); }
/** * @param ctx Cache context. * @param obj Object to marshal. * @return Buffer that contains obtained byte array. * @throws IgniteCheckedException If marshalling failed. */ public static byte[] marshal(GridCacheContext ctx, Object obj) throws IgniteCheckedException { assert ctx != null; return marshal(ctx.shared(), ctx.deploymentEnabled(), obj); }
/** */ private void ackQueryDone(MvccSnapshot snapshot) { if (snapshot != null) cctx.shared().coordinators().ackQueryDone(snapshot, id); }
/** * @return {@code True} if start version. */ public boolean isStartVersion() { return cctx.shared().versions().isStartVersion(ver); }
/** {@inheritDoc} */ @Override public void clear() { try { cache.context().shared().cache().clearStatistics(Collections.singleton(cache.name())); } catch (Exception e) { throw new RuntimeException(e.getMessage()); } }
/** {@inheritDoc} */ @Override public void enableStatistics() { try { cache.context().shared().cache().enableStatistics(Collections.singleton(cache.name()), true); } catch (Exception e) { throw new RuntimeException(e.getMessage()); } }
/** {@inheritDoc} */ @Override public void disableStatistics() { try { cache.context().shared().cache().enableStatistics(Collections.singleton(cache.name()), false); } catch (Exception e) { throw new RuntimeException(e.getMessage()); } } }
/** * Evicts necessary number of data pages if per-page eviction is configured in current {@link DataRegion}. */ private void ensureFreeSpace() throws IgniteCheckedException { // Deadlock alert: evicting data page causes removing (and locking) all entries on the page one by one. assert !lock.isHeldByCurrentThread(); cctx.shared().database().ensureFreeSpace(cctx.dataRegion()); }
/** * * @param cctx Cache context. * @param val0 Invoke value. * @throws IgniteCheckedException If failed. */ private void prepareInvokeValue(GridCacheContext cctx, GridInvokeValue val0) throws IgniteCheckedException { assert val0 != null && addDepInfo; prepareObject(val0.entryProcessor(), cctx.shared()); for (Object o : val0.invokeArgs()) prepareObject(o, cctx.shared()); val0.prepareMarshal(cctx); }
/** {@inheritDoc} */ @Override public void disableStatistics() { try { cache.context().shared().cache().enableStatistics(Collections.singleton(cache.name()), false); } catch (IgniteCheckedException e) { throw new RuntimeException(e.getMessage()); } } }
/** * Get affinity assignment for the given topology version. * * @param topVer Topology version. * @return Affinity assignment. */ public AffinityAssignment assignment(AffinityTopologyVersion topVer) { return assignment(topVer, cctx.shared().exchange().lastAffinityChangedTopologyVersion(topVer)); }
/** {@inheritDoc} */ @Override public void enableStatistics() { try { cache.context().shared().cache().enableStatistics(Collections.singleton(cache.name()), true); } catch (IgniteCheckedException e) { throw new RuntimeException(e.getMessage()); } }
/** {@inheritDoc} */ @Override protected void onKernalStop0(boolean cancel) { if (pendingEntries != null) pendingEntries.clear(); cctx.shared().ttl().unregister(this); }
@Override public void apply(IgniteInternalFuture<?> fut) { try { fut.get(); remap(); } catch (IgniteCheckedException e) { onDone(e); } finally { cctx.shared().txContextReset(); } } });
@Override public void apply(IgniteInternalFuture<AffinityTopologyVersion> fut) { try { fut.get(); mapOnTopology(remap); } catch (IgniteCheckedException e) { onDone(e); } finally { cctx.shared().txContextReset(); } } });
/** * @param obj Object. * @param ctx Context. * @throws IgniteCheckedException If failed. */ protected final void prepareMarshalCacheObject(CacheObject obj, GridCacheContext ctx) throws IgniteCheckedException { if (obj != null) { obj.prepareMarshal(ctx.cacheObjectContext()); if (addDepInfo) prepareObject(obj.value(ctx.cacheObjectContext(), false), ctx.shared()); } }
/** {@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()); }
/** * Leave a cache call entered by {@link #enterNoLock} method. */ public void leaveNoLock() { ctx.tm().resetContext(); ctx.mvcc().contextReset(); // Unwind eviction notifications. if (!ctx.shared().closed(ctx)) CU.unwindEvicts(ctx); }