/** * @return {@code True} if values should be stored off-heap. */ protected boolean isOffHeapValuesOnly() { return cctx.config().getMemoryMode() == GridCacheMemoryMode.OFFHEAP_VALUES; }
/** * @return {@code True} if OFFHEAP_TIERED memory mode is enabled. */ public boolean offheapTiered() { return cacheCfg.getMemoryMode() == OFFHEAP_TIERED && isOffHeapEnabled(); }
/** {@inheritDoc} */ @Override public void start0() throws GridException { spaceName = CU.swapSpaceName(cctx); swapMgr = cctx.gridSwap(); offheap = cctx.offheap(); swapEnabled = enabled && cctx.config().isSwapEnabled() && cctx.kernalContext().swap().enabled(); offheapEnabled = enabled && cctx.config().getOffHeapMaxMemory() >= 0 && (cctx.config().getMemoryMode() == ONHEAP_TIERED || cctx.config().getMemoryMode() == OFFHEAP_TIERED); if (offheapEnabled) initOffHeap(); }
/** * Checks if cache configurations are alike for warmup. * * @param ccfg0 First configuration. * @param ccfg1 Second configuration. * @return {@code True} if configurations match. */ private boolean matches(GridCacheConfiguration ccfg0, GridCacheConfiguration ccfg1) { return F.eq(ccfg0.getCacheMode(), ccfg1.getCacheMode()) && F.eq(ccfg0.getBackups(), ccfg1.getBackups()) && F.eq(ccfg0.getAtomicityMode(), ccfg1.getAtomicityMode()) && F.eq(ccfg0.getAtomicWriteOrderMode(), ccfg1.getAtomicWriteOrderMode()) && F.eq(ccfg0.getMemoryMode(), ccfg1.getMemoryMode()) && F.eq(ccfg0.getDistributionMode(), ccfg1.getDistributionMode()); }
if (cfg.getMaxSpaceSize() == 0 && dataCache.configuration().getMemoryMode() == OFFHEAP_VALUES) U.warn(log, "GGFS max space size is not specified but data cache values are stored off-heap (max " + "space will be limited to 80% of max JVM heap size): " + cfg.getName());
if (cfg.getMaxSpaceSize() == 0 && dataCache.configuration().getMemoryMode() == OFFHEAP_VALUES) U.warn(log, "GGFS max space size is not specified but data cache values are stored off-heap (max " + "space will be limited to 80% of max JVM heap size): " + cfg.getName());
unsafeMemory = cacheCfg.getMemoryMode() == OFFHEAP_VALUES ? new GridUnsafeMemory(cacheCfg.getOffHeapMaxMemory()) : null;
switch (cc.getMemoryMode()) { case OFFHEAP_VALUES: { if (cc.getOffHeapMaxMemory() < 0) throw new IllegalStateException("Unknown memory mode: " + cc.getMemoryMode()); if (cc.getMemoryMode() == GridCacheMemoryMode.OFFHEAP_VALUES) { if (cc.isQueryIndexEnabled()) throw new GridException("Cannot have query indexing enabled while values are stored off-heap. " +
memoryMode = cctx.config().getMemoryMode();
cfg.setDefaultTxIsolation(DFLT_TX_ISOLATION); if (cfg.getMemoryMode() == null) cfg.setMemoryMode(DFLT_MEMORY_MODE);
cfg.pessimisticTxLoggerSize(ccfg.getPessimisticTxLogSize()); cfg.pessimisticTxLoggerLinger(ccfg.getPessimisticTxLogLinger()); cfg.memoryMode(ccfg.getMemoryMode()); cfg.indexingSpiName(ccfg.getIndexingSpiName()); cfg.interceptor(compactClass(ccfg.getInterceptor()));
maxConcurrentAsyncOps = cc.getMaxConcurrentAsyncOperations(); maxQryIterCnt = cc.getMaximumQueryIteratorCount(); memMode = cc.getMemoryMode(); name = cc.getName(); nearStartSize = cc.getNearStartSize();