/** * 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()); }
/** * @return Maximum number of bytes for IGFS data cache. */ public long maxSpaceSize() { DataRegion plc = dataCachePrj.context().dataRegion(); long size = plc != null ? plc.config().getMaxSize() : 0; return (size <= 0) ? 0 : size ; }
/** * @param cache Cache. * @param plcName Policy name. */ private void verifyCacheMemoryPolicy(IgniteCache cache, String plcName) { GridCacheContext ctx = ((IgniteCacheProxy) cache).context(); assertEquals(plcName, ctx.dataRegion().config().getName()); }
cacheCtx.shared().database().ensureFreeSpace(cacheCtx.dataRegion());
assert cctx.mvccEnabled(); PageMemory pageMem = cctx.dataRegion().pageMemory(); int grpId = cctx.groupId();
ctx.shared().database().ensureFreeSpace(ctx.dataRegion());
/** {@inheritDoc} */ @Override protected void start0() throws IgniteCheckedException { compressProc = cctx.kernalContext().compress(); CacheConfiguration cfg = cctx.config(); diskPageCompression = cfg.getDiskPageCompression(); if (diskPageCompression != null) { if (!cctx.dataRegion().config().isPersistenceEnabled()) throw new IgniteCheckedException("Disk page compression makes sense only with enabled persistence."); Integer lvl = cfg.getDiskPageCompressionLevel(); diskPageCompressLevel = lvl != null ? checkCompressionLevelBounds(lvl, diskPageCompression) : getDefaultCompressionLevel(diskPageCompression); DataStorageConfiguration dsCfg = cctx.kernalContext().config().getDataStorageConfiguration(); File dbPath = cctx.kernalContext().pdsFolderResolver().resolveFolders().persistentStoreRootPath(); assert dbPath != null; compressProc.checkPageCompressionSupported(dbPath.toPath(), dsCfg.getPageSize()); if (log.isInfoEnabled()) { log.info("Disk page compression is enabled [cache=" + cctx.name() + ", compression=" + diskPageCompression + ", level=" + diskPageCompressLevel + "]"); } } }
/** * Callback to check the current state. * * @param cache Cache instance. * @throws Exception If failed. */ protected final void check(IgniteCache cache) throws Exception { long pagesActual = ((IgniteCacheProxy)cache).context().dataRegion().pageMemory().loadedPages(); if (loadedPages > 0) { delta += pagesActual - loadedPages; int allowedDelta = pagesDelta(); if (probeCnt++ > 12) { // We need some statistic first. Minimal statistic is taken for a minute. long actualDelta = delta / probeCnt; assertTrue( "Average growth pages in the number is more than expected [allowed=" + allowedDelta + ", actual=" + actualDelta + "]", actualDelta <= allowedDelta); } } long pagesAllowed = pagesMax(); assertTrue("Allocated pages count is more than expected [allowed=" + pagesAllowed + ", actual=" + pagesActual + "]", pagesActual < pagesAllowed); loadedPages = pagesActual; }
cctx.offheap().reuseListForIndex(treeName), cctx.groupId(), cctx.dataRegion().pageMemory(), cctx.shared().wal(), cctx.offheap().globalRemoveId(),
/** * Test node invalidation when cache meta is corrupted. */ @Test public void testCacheMetaCorruption() throws Exception { IgniteEx ignite = startGrid(0); ignite.cluster().active(true); IgniteInternalCache cache = ignite.cachex(CACHE_NAME1); cache.put(1, 1); int partId = cache.affinity().partition(1); int grpId = cache.context().group().groupId(); corruptTreeRoot(ignite, (PageMemoryEx)cache.context().dataRegion().pageMemory(), grpId, partId); ignite.cluster().active(false); stopGrid(0); try { startGrid(0); ignite.cluster().active(true); cache.put(1, 1); } catch (Exception e) { // No-op. } waitFailure(StorageException.class); }
ctx.shared().database().ensureFreeSpace(ctx.dataRegion());
/** * 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()); }
/** * @return Maximum number of bytes for IGFS data cache. */ public long maxSpaceSize() { DataRegion plc = dataCachePrj.context().dataRegion(); long size = plc != null ? plc.config().getMaxSize() : 0; return (size <= 0) ? 0 : size ; }
cacheCtx.shared().database().ensureFreeSpace(cacheCtx.dataRegion());
cctx.offheap().reuseListForIndex(treeName), cctx.groupId(), cctx.dataRegion().pageMemory(), cctx.shared().wal(), cctx.offheap().globalRemoveId(),
ctx.shared().database().ensureFreeSpace(ctx.dataRegion());
assert cctx.mvccEnabled(); PageMemory pageMem = cctx.dataRegion().pageMemory(); int grpId = cctx.groupId();
ctx.shared().database().ensureFreeSpace(ctx.dataRegion());