/** * @param ctx Cache registry. */ public GridLocalCache(GridCacheContext<K, V> ctx) { super(ctx); preldr = new GridCachePreloaderAdapter(ctx.group()); }
/** * @param ctx Context. */ protected GridDhtCacheAdapter(GridCacheContext<K, V> ctx) { this(ctx, new GridCachePartitionedConcurrentMap(ctx.group())); }
/** * @return Partition topology. */ public GridDhtPartitionTopology topology() { return ctx.group().topology(); }
/** * @param ctx Cache context. */ public GridLocalAtomicCache(GridCacheContext<K, V> ctx) { super(ctx); preldr = new GridCachePreloaderAdapter(ctx.group()); }
/** {@inheritDoc} */ @Override public GridCachePreloader preloader() { return ctx.group().preloader(); }
/** {@inheritDoc} */ @Override public int partitions() { return cctx.group().affinityFunction().partitions(); }
/** {@inheritDoc} */ @Override public void printMemoryStats() { super.printMemoryStats(); ctx.group().topology().printMemoryStats(1024); }
/** {@inheritDoc} */ @Override public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(cctx.kernalContext()); U.writeString(out, name()); U.writeString(out, cctx.group().name()); }
/** {@inheritDoc} */ @Override public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(cctx.kernalContext()); U.writeString(out, name()); U.writeString(out, cctx.group().name()); }
/** {@inheritDoc} */ @Override public void start0() throws IgniteCheckedException { affFunction = cctx.config().getAffinity(); affMapper = cctx.config().getAffinityMapper(); aff = cctx.group().affinity(); }
/** {@inheritDoc} */ @Override public void close() { if (rmvd) return; try { ctx.kernalContext().dataStructures().removeAtomicReference(name, ctx.group().name()); } catch (IgniteCheckedException e) { throw U.convertException(e); } }
/** {@inheritDoc} */ @Override public void close() { if (rmvd) return; try { ctx.kernalContext().dataStructures().removeAtomicLong(name, ctx.group().name()); } catch (IgniteCheckedException e) { throw U.convertException(e); } }
/** {@inheritDoc} */ @Override public void close() { if (rmvd) return; try { ctx.kernalContext().dataStructures().removeAtomicStamped(name, ctx.group().name()); } catch (IgniteCheckedException e) { throw U.convertException(e); } }
/** {@inheritDoc} */ @Override public void close() { try { if (rmvd) return; ctx.kernalContext().dataStructures().removeSequence(name, ctx.group().name()); } catch (IgniteCheckedException e) { throw U.convertException(e); } }
/** {@inheritDoc} */ @Override public void close() { if (!rmvd) { try { ctx.kernalContext().dataStructures().removeSemaphore(name, ctx.group().name()); } catch (IgniteCheckedException e) { throw U.convertException(e); } } }
/** {@inheritDoc} */ @Override public void close() { if (!rmvd) { try { ctx.kernalContext().dataStructures().removeCountDownLatch(name, ctx.group().name()); } catch (IgniteCheckedException e) { throw U.convertException(e); } } }
/** * */ public static Throwable validate( GridCacheContext cctx, Object key, OperationType opType, Collection<Integer> lostParts ) { CacheGroupContext grp = cctx.group(); PartitionLossPolicy lostPlc = grp.config().getPartitionLossPolicy(); int partition = cctx.affinity().partition(key); return validate(cctx, key, partition, opType, lostPlc, lostParts); }
/** {@inheritDoc} */ @Override public void close() { if (!rmvd) { try { boolean force = sync != null && (sync.isBroken() && !sync.failoverSafe); ctx.kernalContext().dataStructures().removeReentrantLock(name, ctx.group().name(), force); } catch (IgniteCheckedException e) { throw U.convertException(e); } } }
/** * Checks that cluster-wide parameters are consistent between two caches. * * @param one Cache context. * @param other Cache context. */ private void checkCacheContextsConsistency(GridCacheContext one, GridCacheContext other) { Assert.assertEquals(one.statisticsEnabled(), other.statisticsEnabled()); Assert.assertEquals(one.dynamicDeploymentId(), other.dynamicDeploymentId()); Assert.assertEquals(one.keepBinary(), other.keepBinary()); Assert.assertEquals(one.updatesAllowed(), other.updatesAllowed()); Assert.assertEquals(one.group().receivedFrom(), other.group().receivedFrom()); }
/** * Test for check checkpoint size metric. * * @throws Exception If failed. */ @Test public void testCheckpointBufferSize() throws Exception { IgniteEx ig = startGrid(0); ig.cluster().active(true); DataRegionMetricsImpl regionMetrics = ig.cachex(DEFAULT_CACHE_NAME) .context().group().dataRegion().memoryMetrics(); Assert.assertTrue(regionMetrics.getCheckpointBufferSize() != 0); Assert.assertTrue(regionMetrics.getCheckpointBufferSize() <= MAX_REGION_SIZE); }