/** * @param ctx Context. * @param ldr Loader. * @throws IgniteCheckedException If failed. */ public void unmarshalValue(GridCacheContext<?, ?> ctx, ClassLoader ldr) throws IgniteCheckedException { if (val != null) val.finishUnmarshal(ctx.cacheObjectContext(), ldr); }
/** * @param ctx Context. * @throws IgniteCheckedException If failed. */ public void prepareMarshal(GridCacheContext ctx) throws IgniteCheckedException { key.prepareMarshal(ctx.cacheObjectContext()); }
/** * @param ctx Context. * @param ldr Class loader. * @throws IgniteCheckedException If failed. */ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException { assert key != null; key.finishUnmarshal(ctx.cacheObjectContext(), ldr); }
/** * @param cctx Cache context. * @throws IgniteCheckedException In case of error. */ void prepareMarshal(GridCacheContext cctx) throws IgniteCheckedException { if (key != null) key.prepareMarshal(cctx.cacheObjectContext()); if (newVal != null) newVal.prepareMarshal(cctx.cacheObjectContext()); if (oldVal != null) oldVal.prepareMarshal(cctx.cacheObjectContext()); }
/** * @param obj CacheObject to marshal * @param ctx context * @throws IgniteCheckedException if error */ private void prepareMarshalObject(CacheObject obj, GridCacheContext ctx) throws IgniteCheckedException { if (obj != null) obj.prepareMarshal(ctx.cacheObjectContext()); }
/** * This method is called after the whole message is received * and is responsible for unmarshalling state. * * @param ctx Context. * @param ldr Class loader. * @throws IgniteCheckedException If failed. */ public void finishUnmarshal(GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException { if (val != null) val.finishUnmarshal(ctx.cacheObjectContext(), ldr); }
/** * @param cpy Copy flag. * @return Key value. */ protected Object keyValue(boolean cpy) { return key.value(cctx.cacheObjectContext(), cpy); }
/** * @param ctx Cache context. * @throws IgniteCheckedException In case of error. */ public void marshal(GridCacheContext ctx) throws IgniteCheckedException { marshal(ctx.cacheObjectContext()); }
/** * @param ctx Context. * @throws IgniteCheckedException If failed. */ public void prepareMarshal(GridCacheContext ctx) throws IgniteCheckedException { key.prepareMarshal(ctx.cacheObjectContext()); }
/** * @param obj CacheObject un to marshal * @param ctx context * @param ldr class loader * @throws IgniteCheckedException if error */ private void finishUnmarshalObject(@Nullable CacheObject obj, GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException { if (obj != null) obj.finishUnmarshal(ctx.cacheObjectContext(), ldr); }
/** {@inheritDoc} */ @Override public Object unwrapTemporary(GridCacheContext ctx, Object obj) throws BinaryObjectException { if (!ctx.cacheObjectContext().binaryEnabled()) return obj; if (obj instanceof BinaryObjectOffheapImpl) return ((BinaryObjectOffheapImpl)obj).heapCopy(); return obj; }
/** {@inheritDoc} */ @Override public void finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException { super.finishUnmarshal(ctx, ldr); GridCacheContext cctx = ctx.cacheContext(cacheId); key.finishUnmarshal(cctx.cacheObjectContext(), ldr); if (val != null) val.finishUnmarshal(cctx.cacheObjectContext(), ldr); }
/** * @return Cache object context. */ private CacheObjectContext objectContext() { if (ctx == null) return null; return ctx.cache().internalCache(cacheName).context().cacheObjectContext(); }
/** * @param cacheName Cache name. * @return Cache object context. */ private CacheObjectContext cacheObjectContext(String cacheName) { return ctx.cache().internalCache(cacheName).context().cacheObjectContext(); }
/** * Returns cache object context if created or creates new and caches it until cache started. * * @param cacheId Cache id. */ @Nullable public CacheObjectContext cacheObjectContext(int cacheId) throws IgniteCheckedException { GridCacheContext<K, V> ctx = ctxMap.get(cacheId); if (ctx != null) return ctx.cacheObjectContext(); DynamicCacheDescriptor desc = cache().cacheDescriptor(cacheId); return desc != null ? desc.cacheObjectContext(kernalContext().cacheObjects()) : null; }
/** {@inheritDoc} */ @Override public <K, V> CacheEntryImplEx<K, V> wrapVersioned() { lockEntry(); try { return new CacheEntryImplEx<>(key.<K>value(cctx.cacheObjectContext(), false), null, ver); } finally { unlockEntry(); } }
/** * @param cache Cache. */ private static boolean storeValue(IgniteCache cache) { return ((IgniteCacheProxy)cache).context().cacheObjectContext().storeValue(); }
/** * @param cache Cache. */ private static boolean storeValue(IgniteCache cache) { return ((IgniteCacheProxy)cache).context().cacheObjectContext().storeValue(); }
/** {@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()); }
/** * @param cctx Context. * @param row Row. * @param expKey Expected row key. * @param expVal Expected row value. */ private void checkRow(GridCacheContext cctx, CacheDataRow row, KeyCacheObject expKey, Object expVal) { assertNotNull(row); assertEquals(expKey, row.key()); assertEquals(expVal, row.value().value(cctx.cacheObjectContext(), false)); }